Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

javascript unicode

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello everyone...
i know a lot of very good javascript coders here and im in dire need of yuor help...
im building a web application using struts... im placing all of my messages in a properties file.
anyway, one of my messages is formatted this way.

in my jsp file i put this in the alert function as

the this is it shows the text as is "판매품목" is diasplayed...
i did some i research and found out that it should be in the unicode format \uXXXX...
maybe someone could give me code to convert 판 strings to \u54032... basically removing "&#" in the front and ";" in the back...
thanks a lot...
chard
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
wouldn't it be easier to do this on the server side and not on the client side. The client side is not reliable and can be turned off so your code will not work on the browser.
basically if you want to do it on the client side then you need to look into replace() method with regular expressions....
general idea is here:

Eric
[ March 02, 2004: Message edited by: Eric Pascarello ]
 
Jay Richards
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thx..
i did try doing that but alert just wont show up the correct korean character...
i have this code that display correctly in my browsers

how can i display this in javascript in the correct format... i.e. actually korean characters.
pls help me out anyone...
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
did you try just manually typing in \51333\47448\47749 and seeing if that shows up?
Do you have the meta tag to show the correct characterset?
 
Jay Richards
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have the correct meta tags cause i can show the correct characters in the browser... what i need is to be able to show the same characters using javascript. the original string is in the &#xxxxx; format... i followed one of the advise to replace &# with \\u for unicode...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic