You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Thom Hehl <th...@nowhereatall.com> on 2005/08/05 01:30:52 UTC

CGI character translation??? Resolved

OK, just to help out others with the pain I have suffered over this issue.

Both Apache and Java take pains to support internationalization. This is 
the root of the problem.

When writing the output file from java, it was picking up the character 
set from the Apache environment. In both of the Apache servers I found, 
it was an ANSI character set even though everything else in the 
operating system was running UTF-8.

This was the reason that when I ran my program from the command prompt 
it worked fine because the command prompt was running under UTF-8. When 
running under Apache, though, it was translating my special unicode 
characters incorrectly because I needed to use the UTF-8 character set 
to get my character.

After a week of research, I finally figured out to use the 
OutputStreamWriter class and give it "UTF-8" as the character set to use 
for that file and everything is now working fine.

Hope this helps someone else. Sorry for slightly off-topic, but was good 
information anyway.