• Post Reply Bookmark Topic Watch Topic
  • New Topic

same code for jsp and html, but display different character set  RSS feed

 
Michael L. Zhang
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the below source code for a jsp file, and I also renamed it to be a htm file. I try to display Japanese characters in both files.

The htm file has no problem to display Japanese characters since it is able to use the correct charset -"shift-jis"; but the jsp file can not display Japanese characters correctly, it is not picking up the correct charset, the jsp always pick up the ISO instead of "shift-jis".But when I right click the mouse to "view source" in the browser, both files are identical actually.

Any one know what is the problem with the jsp file?

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not really savvy with char set issues, but perhaps the difference is in the response headers?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. There are plugins for Firefox that will allow you to view the headers.
 
Michael L. Zhang
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear, thanks. Can you tell what plugin and where to get the plugin?

If we are able to view the headers by one way or the other, how that will help me to view the Japanese characters in jsp file?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that the plugin is called LiveHTTPHeaders or something like that and should be available from mozilla.org.

I'm not sure if the headers are even your problem, I'm just suggesting it as a place to look for possible clues. If the HTML that is being delivered to the pages is identical, then the headers are one way that the browser can be getting different information from the server that might affect how it displays the page.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!