Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    Iran
    Posts
    695
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Writing Unicode with JS

    How can I write unicode with javascript? Is it possible? What I see around here is that ppl use FrontPage and a program called Keyman for writing unicode, is there anyway that we don't use Frontpage? I couldn't understand what Frontpage really does and if we can do that ourselves. Many thanks in advance...

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can use unicode escape sequences in JavaScript (I believe since JS1.5). They are fairly easily employed, you just write '\uXXXX' and in place of the x'es you write the desired hexadecimal digits of your unicode character.

    As an example,

    Code:
    alert("Hello \u00C5land");
    gives you an alert with the scandinavian capital A with the ring on top. I don't know how far unicode is supported by the browsers, you'll have to test yourself.

    See also
    http://devedge.netscape.com/library/...t.html#1009568

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    Iran
    Posts
    695
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    Thank you mordred, but one more question, what do you do if you want to write unicode? Do you use Front Page? I said ppl around me use a software called Keyman and also Frontpage to write unicode, I wanted to see if it's another/other way(s) for doing that, and also I saw somewhere a function called "getunicode()" or something like that that I think was for JS, what JS can do for this unicode and how far does it support it?
    Last edited by ConfusedOfLife; 08-25-2002 at 11:48 PM.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't know this keyman program and I have had no exposure at all to FrontPage (luckily ), so I can't comment on how they work and if there are any substitutes. Since I'm based in Europe and most of my characters used in web apps would be either in the ASCII subset or easily represented as HTML entities, I have not had the need to develop anything in unicode entirely, sorry, just no real experience in that field.

    What do you want to achieve anyway? Do you want to write a webpage or a javascript app entirely in unicode? I recall that you can set the encoding of xml/xhtml to unicode, so you could do all your coding in that charset (but I'm not 100% positive on this).

    As to support... I'll guess you have to find out yourself by testing the browsers if they stand true to what the browser vendors promise.

  • #5
    Regular Coder
    Join Date
    Jul 2002
    Location
    Iran
    Posts
    695
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, I write unicode pages! But as I said you have to write your page first, then open the page in Frontpage and press ( shift + rightAlt) and start typing, if the keyman is installed and you did the modifications on your frontpage, then what you see is the characters that you want ( Farsi language in my case ), but like you, I didn't work with frontpage either ( luckily! ) and I'm not easy with it. Also I think if it's possible to write unicode without frontpage, then, let's write it! It's not just writing that, By learning how to do something, you will find some new doors in front of you that you can go for, you know what I mean! I just want to know at least how to write unicode in some other ways! ( excluding the frontpage)
    Last edited by ConfusedOfLife; 08-26-2002 at 12:42 AM.


  •  

    Posting Permissions

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