Baris EFE wrote:
>
> I get the string from servlet as a result of a query. But i can't see some
> some special character.
>
> when i write " System.getProperties().getProperty("file.encoding") "
> i get: "8859_1"
> which returns the
> server's encoding.
>
> i should replace the encoding to:
> "Cp1254"
>
> I'm using solaris 7.
> What should i do to change the server's encoding to see some specail
> characters!!
> Thanks!!
You can set your LC_ALL enviroment variable, it specifies
the operating system locale. Use something like
export LC_ALL=tr_TR
java MyClass
But I think that will set the file.encoding to the standard
"ISO-8859-9" encoding, not to MS-Windows "Cp1254".
Other possibility is setting the file.encoding directly by
java -Dfile.encoding=Cp1254 MyClass
but it is not guaranted to work, since SUN doesn't allow
to set this property on command line.
So the only correct way is to use localized classes like:
java.io.InputStreamReader isr =
new java.io.InputStreamReader(
new java.io.FileInputStream("myfile.txt"), "Cp1254" );
Martin
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html