I had a very different issue lately. My requirement was to generate a CSV file from an Application Engine. The CSV file could contain Japanese or English characters. The Japanese characters were retrieved from Message Catalog and the English characters were hard-coded. But, when the CSV file was opened using Microsoft Excel 2007/2010, some of the characters were displayed properly whereas the rest appeared as dots.
It appears that, for the Japanese characters to be displayed properly you need to have proper character set/encoding defined in excel. Only then, all the Japanese/other language characters for that matter would be displayed properly.
There is a work around for this issue – to ensure that your file displays other language characters properly. Please follow steps provided below:
- Save the file in .csv format from Process Monitor
- Open an instance of Excel, click on the Data tab, then click on the From text button, choose the CSV file and click on the Import button
- Choose delimited radio button and File Origin as 932 : Japanese (Shift-JIS)
- Click Next all the way and then Finish
- The Japanese characters would now shop on the excel sheet properly
Whenever you open a CSV file for writing in PeopleCode, if the content to be written has Japanese characters, ensure to use the CP932 character set. To get the character set associated with your language, you can use the following query:
select * from PSLANGUAGES where LANGUAGE_CD = 'JPN'
Use the charset specified under the WINDOWS_CHARSET field
For instance, your PeopleCode should look like this:
&f = GetFile(&sFilename, "W", "CP932", %FilePath_Relative);
Have fun 🙂