• 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:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • 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...
 
A magnificient life is loaded with tough challenges. En garde tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic