By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,516 Members | 1,148 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,516 IT Pros & Developers. It's quick & easy.

foreign letters in alert ()

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.