Skip to main content

java - UTF-8 encoding garbled using eclipse, spring, tomcat 7 on mac -


edit: please ignore question below now. seems working now. perhaps cached in browser, once fixed, still wasn't displaying right. seems ok in both chrome , firefox, i'll assume it's ok now. thanks..

i writing java web application using eclipse, spring , tomcat 7. servlet returns html, including javascript file follows:

<script type="text/javascript" charset="utf-8" src='loc/loc_de.js'></script> 

when @ file loc_de.js in eclipse, german characters display fine. when load js file through firefox , view->character encoding, firefox says encoded in utf-8. i've set workspace default in eclipse utf-8. i've changed tomcat web.xml, adding following default servlet servers static resources:

<init-param> <param-name>fileencoding</param-name> <param-value>utf-8</param-value> </init-param> 

and yet german accented characters come out weirdly garbled.. grateful if can tell me else need doing.. thanks!

java - utf-8 encoding garbled using eclipse, spring, tomcat 7 on mac - stack overflow

learn, share, build

each month, on 50 million developers come stack overflow learn, share knowledge, , build careers.

join world’s largest developer community.

sign up

edit: please ignore question below now. seems working now. perhaps cached in browser, once fixed, still wasn't displaying right. seems ok in both chrome , firefox, i'll assume it's ok now. thanks..

i writing java web application using eclipse, spring , tomcat 7. servlet returns html, including javascript file follows:

<script type="text/javascript" charset="utf-8" src='loc/loc_de.js'></script> 

when @ file loc_de.js in eclipse, german characters display fine. when load js file through firefox , view->character encoding, firefox says encoded in utf-8. i've set workspace default in eclipse utf-8. i've changed tomcat web.xml, adding following default servlet servers static resources:

<init-param> <param-name>fileencoding</param-name> <param-value>utf-8</param-value> </init-param> 

and yet german accented characters come out weirdly garbled.. grateful if can tell me else need doing.. thanks!

share|improve question
    
have checked default encoding of firefox? utf-8? not default encoding.. – joseph elcid jul 7 '12 @ 13:07
    
are accented characters damaged (say, in database) , being displayed faithfully in utf-8 format? try looking @ source data see if it's okay before try figure out what's wrong webapp. – christopher schultz jul 9 '12 @ 1:08

your answer

 
discard

posting answer, agree privacy policy , terms of service.

browse other questions tagged or ask own question.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -