aspose file tools*
The moose likes Servlets and the fly likes local encodings in servlets outputs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "local encodings in servlets outputs" Watch "local encodings in servlets outputs" New topic
Author

local encodings in servlets outputs

Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
i guess them some of you living in the countries where the native language is not written with the latin letter had this problem too.
trying to out.println a string written in
(the languages i met this problem at)
russian, ukrainian,hebrew,arabic
i get in the servlet result which looks like this : ??? ? ??? , ?? ??? ?? , ???.
there is an encoding problem i didn't find any solution to. i understand that i can use jsp and don't out.println from inside the servlet, but still, i'm looking for a solution.
thank's.


Asher Tarnopolski
SCJP,SCWCD
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
Have you tried using the setHeader method to set the content language to the language that you are trying to output?

------------------
Matthew Phillips
Sun Certified Programmer for Java 2 Platform


Matthew Phillips
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
thank's for reply, yup i did try
to set Content-Language header. it didn't help.
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
ok,i found the solution. i have to
add a header to the HttpServletResponse object:
name of the header: "contentType"
value: "text/html; charset=windows-1255"
thank's anyway
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: local encodings in servlets outputs