Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

unicode and reset() method

  Asked By: Ibthaj    Date: Apr 28    Category: Java    Views: 845
  

i have a problem with unicode as describ it below:
i have a text field(userName) in my jsp and when i want to fill it
through reset() method in my ActionForm with a farsi string that is
in form of unicode like(#&8524;#&2068;...)string unicode appears in
the field rather than farsi string.

Aside:i fill userName field with setter method of my actionform
(ie:setUserName("#&8524;#&2068;..."))

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Arthur Cole     Answered On: Apr 28

Are you sure your page encoding (the one in HTTP header, not the one in
meta i.e. charset), is a unicode  enable one(like UTF-8)? (Can get this via
right click in Firefox and see Page Info-> Encoding)

I think the problem  is with in your page encoding. Change it to UTF-8 and
every thing will be all right. You can use JSP's "<%@ page
pageEncoding="UTF-8" %>" tag to achive this.

 
Answer #2    Answered By: Jim Williamson     Answered On: Apr 28

The stuff that u provided aren’t Unicode!
Java Unicode characters start with \u ,yours are HTML Unicode. You may supply your methods either Farsi characters or Unicode representation of them.
To convert Farsi to Unicode you may use native2ascii tool provided by JVM or use this
site http://www.snible.org/java2/uni2java.html

String greeting=”\u062F\u0631\u0648\u062F”; //Drood in Farsi

 
Didn't find what you were looking for? Find more on unicode and reset() method Or get search suggestion and latest updates.




Tagged: