in reply to Error message in script with Japanese characters

I don't know what your line 52 may be, but here is a problem you may have:

In the Japanese .ini file, the codes for those letters may be different. What "code page" (encoding system) is the file using? It may be using two-byte sequences for some characters, one byte for others, and different from the accented letters in the Latin-1 code page.

The best thing to do is transcode the INI file from whatever it's written in to Perl's native UTF-8 encoded Unicode. Then with use utf8; in effect, your tr or s/// will work just fine. Then, transcode the result to the desired character set.

That stuff is built into Perl 5.8 ! If you aren't using it yet, this might be a compelling reason.

—John

  • Comment on Re: Error message in script with Japanese characters