Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2008

Tip: Looking for answers? Try searching our database.

Change Default-Encoding in jvm.cfg

Thread view: 
henning.schnieder@infor.com - 03 Apr 2008 10:40 GMT
Hi Experts,

I am new with Java. Within an integration I get strange behaviour
caused of different Codepages of the server and the clients. Is it
possible to enter a default for the property "file.encoding" in the
file "jvm.cfg" and what is the syntax?

Thanks in Advance
Gordon Beaton - 03 Apr 2008 11:04 GMT
> I am new with Java. Within an integration I get strange behaviour
> caused of different Codepages of the server and the clients. Is it
> possible to enter a default for the property "file.encoding" in the
> file "jvm.cfg" and what is the syntax?

Exactly what "strange behaviour" are you experiencing?

Any software that depends on the default encoding being correct is
implicitly broken, for distributed applications even more so. You
should code your application to use the encoding it needs, regardless
of any local defaults.

Here's a possible clue: instead of using FileReader/Writer, use
InputStreamReader/Writer which let you specify the encoding.

/gordon

--
Marcelo Morales - 03 Apr 2008 13:56 GMT
> > I am new with Java. Within an integration I get strange behaviour
> > caused of different Codepages of the server and the clients. Is it
[quoted text clipped - 14 lines]
>
> --

Hi

I agree with Gordon. _Never_ rely on default encoding being right.

I'm no expert, but a seasoned programmer. Encoding has always been a
pita for me, regardless of programming language, platform or os. Since
the introduction of nio, Java has become stronger imho.

java.nio.charset.Charset.availableCharsets().keySet() should give you
a nice list of supported encodings. It might differ from one platform
to another and from one jvm to the next (check out MacRoman). You can
set the default java encoding using the file.encoding property.

Marcelo Morales


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.