Issues with Japanese characters in CSV file – Application Engine

All,

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:

 

  1. Save the file in .csv format from Process Monitor
  2. 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
  3. Choose delimited radio button and File Origin as 932 : Japanese (Shift-JIS)
  4. Click Next all the way and then Finish
  5. 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 🙂

Advertisements

About Manikandan Surendren

A PeopleSoft Techno-functional Consultant. An engineering graduate in Computer Science. Technology Enthusiast. Movie freak. Gadget geek.
This entry was posted in Code, Oracle, PeopleSoft, SQL. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s