Hi all,
I have a requirement to pass japanese characters using hidden variables from one jsp to another. Can anyone please tell me the most effective way of achieving this.
Obviously you would have to initialize japaneseText for this example to work.
Also you need to make sure you set the proper Content-type for the JSP. This should be done at the top of the page. We usually use UTF-8 but it may or may not support the entire character set you need. You will need to determine that yourself. Example:
Note: if you view source on the JSP then you will see the value of the hidden inputs but most text programs do not support UTF-8 so you will not see Japanese text. To text this I suggest setting a hidden input with Japanese text and submitting another JSP which displays it. Remember you will also need to set the content to UTF-8 for that page as well. Lastly, UTF-8 is not supported by all browsers anything before IE 4 will not work and we have experienced some bugs with Netscape's support for UTF-8.
Hi Wushutwist,
Thanx for the reply. I have one more query, the japanese character set that we will be using will most probably be SJIS will this method work for that as well?
I have never used it but if it is a valid HTML charset then you will be fine. The only problem is that most browser probably don't come equipped with that character set by default. Also if you want to display English in addition to Japanese you will need to see if SJIS supports the English. UTF-8 takes care of most of these problems. Wushutwist
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.