SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Multi language issue

    Hello,
    i have a .js file that just have a js function.
    with in that function, i need to assign a word to a variable in japanese charactors. if i put that and attempt to save the document, the message "The documents current encording cannot save all the charactors with in the document. you may want to change to utf-8 or an encording that supports the special charactors in the documet."

    So how can i put the japanese charactors in the js document ?

    Thank You !

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,682
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    What is the program you're using to save the file?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can write unicode text to both the document and alert boxes etc using the unicode number for each character:
    Code:
    <script>
    var myJapaneseText="\u330e;\u333d;\u3370;\u3387;";
    window.onload = function () {alert(myJapaneseText)};
    document.write(myJapaneseText);
    </script>

  4. #4
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    pmw57, sorry, i forgot to mension the name of the editor.
    i am using dream viewer.

    Thanks Jimfaraser,
    but i am afride that this will not going to workout for me.
    coz even i cant see the japanese letters. all boxes. i use google translator.
    so actually i no nothing about japanese. but i need a word in the program.
    so finding each japanese charactors unicode value is impossible it looks like


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •