How do I open a file that has Japanese characters in the filename

Hello,

I have an application running on English and Japanese OS. When it comes to the Japanese version, I cannot open a file, using a filename from the Microsoft CommonDialog control, I get a Bad Filename error code.

Here is the code I am using

Dim f$

CommonDialog1.ShowSave
   
f$ = CommonDialog1.filename

iunit = freefile
Open f$ for Output as #iunit

I am using VB5

Any help greatly appreciated,
Mike
gmikeAsked:
Who is Participating?
 
burningmaceCommented:
I had a similar problem. Unfortunately, unless your system is in Japanese mode at the actual time, there's not a solution (that I know of). Usually, ASCII and Extended ASCII characters only are accepted in filenames. When you're using the Japansese language, the OS translates ASCII character values across to Japanese characters. When you switch back to English, the characters appear garbled or just as blocks. This is because the OS doesn't recognise what they are in terms of standard characters. The best thing to do would be to rename the file to something that can be read by the application.
0
 
BrownheadCommented:
Could you upload an example of the chinese characters to a webhost (http://uppit.com/) so we can have an example for testing... because I've never seen Japenese file names before
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.