Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

local encodings in servlets outputs

 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank's for reply, yup i did try
to set Content-Language header. it didn't help.
 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic