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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a Japanese directory?

Status
Not open for further replies.

cpjust

Programmer
Sep 23, 2003
2,132
US
Hi, I'm trying to figure out how to create a directory with a Japanese name.

Preferably, I'd like to do this from a batch file, but I'll settle for a C++ solution if it can't be done in a batch file.

I have a Unicode Japanese string, but I can't use that directly because it has illegal filename characters (plus I doubt it would be recognized as Japanese anyways).
 
Are you running on Japanese Windows or English Windows. Japanese windows uses DBCS - MS Gothic. On XP and 2K, it is quite easy.

First install Japanese as an input language from the regional settings in control panel. This will also install the DBCS fonts used by Japanese.

Then open explorer and click where you see EN in the system tray. A pop will show you JP. Click on that and your input will now be in Japanese. There are several forms of input:

Hiragana
Katakana
Kanji
IME Pad

Pick one and whatever you rename your file to will be Japanese.

 
I'm using English and Japanese Windows.
I know how to create Japanese text by hand, but I need to automate a test which will create Japanese directories (if they don't already exist) so I can test some software for DBCS compliance.
 
What are you using as a test tool? WinRunner, QTP, Visual Test or are you planning to use Windows scripting host. If you're using WSH, try the VBScript Forum

You can use chrw to create the unicode characters in a string and then send them to the application using sendkeys. If you stick the following into a wsf file, it will print "how are you" in chinese on the screen.
Code:
<job>
<script language="vbscript">
dim strGreeting
strGreeting = chrw (20320) & chrw (22909) & chrw (39532)
WScript.Echo strGreeting
</script>
</job>
 
I'm testing a C++ API, so I'm using a C++ test harness. I use batch and shell scripts to setup my test environment and start the various test harnesses. The environments I'm testing on are Windows 2000/2003, Solaris & Linux.

I just need to create a Japanese directory, then copy some test files into that directory so my test harness can try to access those files after I pass a Japanese directory to the API...
 
Try something like
Code:
#include <tchar.h>
...
_tmkdir (_T("\x4f69\x597d\x9A6C"));
Make sure that _UNICODE is defined.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top