Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to open files with non ASCII characters in their name ?

Status
Not open for further replies.

zikar

Programmer
Oct 10, 2000
31
JP
Hello,

My question is about opening a file with non ASCII characters in its name.

Under Windows 2000 (English version) :
I have a program working fine, as long as I only open files with a name made of ASCII characters. If on the other hand, I try to open a file with Japanese characters in the name or in the path; then not only it cannot be opened, but I am not even able to open any other file after that trial. I have to close the program and restart it, in order to use it again.

Looking at this problem under the debugger, I have seen that :
"OpenDialog->Execute()" always returns "false" once I have tried to open a "wrong file". Is there something I should do to reinitialize OpenDialog, so that it can work without having to close the program ?

I have written the program using C++BUILDER 5.0 (English version), under Windows 2000 (English version).

If I try to use this same program under Windows 2000 (Japanese version), then I can open any file, but its name is not displayed properly if it contains non ASCII characters.

Even though I use C++BUILDER 5.0 (English version) to develop the software; is there a way to proceed so that I will be able to work also with files having non ASCII characters in their names ?

Thanks for any suggestion.

Michel
 
You are going to have use "Internationalization" files. I have seen references to this for European langauges but not for Japanese. I'm not even certain which libraries to use. All I know is that this allows you to open files with other non-English letters. I also suspect that you will need to use Unicode. This means that, for example, you would replace char with wchat_t and istream with wistream. Some characters in Unicode are bit shifted while others require a look-up table. That's about the full extent of my knowledge on this subject.
James P. Cottingham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top