469,590 Members | 1,949 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,590 developers. It's quick & easy.

foreign letters in alert ()

Is there a way to have non-English letters and symbols, such as the
Greek letters or copyright sign, to appear in the box of alert()? Or is
the alert () also available to people with other writing systems? I
tried with such as δ. It didn't display.

This question is also for the prompt ().

Thanks.

Aug 23 '05 #1
3 2450
Ivo
"dalei" wrote
Is there a way to have non-English letters and symbols, such as the
Greek letters or copyright sign, to appear in the box of alert()? Or is
the alert () also available to people with other writing systems? I
tried with such as δ. It didn't display.

This question is also for the prompt ().


HTML escapes won't work. Unicode works better, but also not for all symbols.

window.alert( '\u00a9 is the copyright symbol.' ) )

hth
ivo
Aug 23 '05 #2
ASM
dalei wrote:
Is there a way to have non-English letters and symbols, such as the
Greek letters or copyright sign, to appear in the box of alert()? Or is
the alert () also available to people with other writing systems? I
tried with such as δ. It didn't display.

This question is also for the prompt ().

Thanks.


alert('hello from St\xe8phane');

JS use UTF-16 encodding
In my example Hexa is used ( kind of UTF-8)

to insert a '' (HTML entity : ê) in a JS string
you can write :
\xea \xEA \xea or \u00ea

You can go here (french page, but a carateres table stay a table)
http://www.miakinen.net/vrac/charsets
while overing a caractere,
in a separate block, are displayed correspondances
example : (beta)
- Unicode : U+00DF -> alert('f = \x00dfx');
- Hexa : DF -> alert('f = \xdfx');

copyright : \a9 or \x00a9
2 square : alert('4\xb2 = 4 x 4 = 16'); -> \xb2 or \x00b2

alert('\xbf se habla espa\xf1ol ?');
--
Stephane Moriaux et son [moins] vieux Mac
Aug 23 '05 #3
Thank all for help. After testing successfully the \xb2 and \xoob2 for
superscript 2, I tried \xb1, \xb2 \xb3 and \xb4 for superscripts 1 to
4. But only 2 and 3 display as expected. 1 and 4 are other symbols.
Could anyone teach me how to get superscripts 1 and 4?

I wish this thread has not been pushed too far from head of this forum.
Thanks again in advance.

Aug 24 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Carlos Marangon | last post: by
1 post views Thread by dalei | last post: by
6 posts views Thread by Jerome | last post: by
1 post views Thread by Trond Engebråten | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.