foreign letters in alert ()

D

dalei

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.
 
I

Ivo

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
 
A

ASM

dalei said:
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 ?');
 
D

dalei

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top