I had installed the CJK language pack on my machine. I use a C program to print out single byte and double byte Japanese characters to a text file. However, when I open the file in notepad, its all junk. I even set the font to MS PMincho and Japanese script. But that didn't solve the problem. Any idea of how to view the Japanese characters?
My guess would be that Notepad doesn't handle Unicode, and you'll have to find a different text editor. Among others, any text editor or IDE designed for Java programming should work (jEdit or Eclipse, for instance) since Java supports Unicode.
Since you said single byte and multi byte japanese characters I feel you are using Windows codepage characters rather than unicode. And Be carefull while mixing single/double byte in a stream as this will cause problems if a single byte misplaced.
John what OS are you using? Windows 2000 Pro's notepad will display Japanese fine. I use it to develop Japanese content on my English OS.
When you say "single or double byte," what coding system are you using? For Japanese the two most common systems are Shift-JIS and Unicode. AFAIK only the Japanese version of Windows will display Shift-JIS correctly in any context, whereas all Windows should display Unicode correctly. ("in any context", i.e. outside of Internet Explorer, which lets you choose any coding system on any version of Windows).
We used notepad to create Unicode INI files so it definitely can do the job (after W2K). In addition to the advice you have already received, make sure that the font selected for display in notepad is one that supports the characters. Arial MS Unicode perhaps.
Am using Win2K. I used MultiByteToWideChar and codepage 932 to convert to wide character and used printf ("%S", wszJpnChar). Am I doing the right thing?
John I think In your file you have set BOM at the beginning to tell the editor that the content is unicode. BOM is byte order mark(If I'm not wrong) which is 2 bytes with value 0xFF 0xFE OR 0xFE 0xFF depending whether you are using big endian or little endian 16 bit unicode.
I see John, I think what is happening is you are producing a file in UTF-16 or Shift-JIS. It might be better to stick with UTF-8.
Fog Creek Home