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

Posted on 2006-05-18
Last Modified: 2010-05-01

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$

f$ = CommonDialog1.filename

iunit = freefile
Open f$ for Output as #iunit

I am using VB5

Any help greatly appreciated,
Question by:gmike
    LVL 1

    Expert Comment

    Could you upload an example of the chinese characters to a webhost ( so we can have an example for testing... because I've never seen Japenese file names before
    LVL 5

    Accepted Solution

    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.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now