Unicode characters

S

schneider

as a biginner,

maybe I have a question already answered 1000 times but I do not know
how to find the answers.

problem:

depending on an input value, I would like to output greek characters
(f. e. those between U+03B1 to U+03C9. One way would be to define two
arrays: one with the possible input values ("abgde...") and a second
array with the corresponding values ("\u03b1\u03b2\u03b3...").

But I hoped I could skip the second by a computation, f.e. "g" has
index 2 in the first array, so output "\u03b1"+2.

This does not work (of course). But do I have a chance to "compute"
the output value?

Thanks
Hanspeter
 
J

Janwillem Borleffs

But I hoped I could skip the second by a computation, f.e. "g" has
index 2 in the first array, so output "\u03b1"+2.

This does not work (of course). But do I have a chance to "compute"
the output value?

Perhaps is the following useful:

alert(String.fromCharCode("\u03b1".charCodeAt(0) + 2));


JW
 
B

Bart Van der Donck

maybe I have a question already answered 1000 times but I do not know
how to find the answers.

problem:
depending on an input value, I would like to output greek characters
(f. e. those between U+03B1 to U+03C9. One way would be to define two
arrays: one with the possible input values ("abgde...") and a second
array with the corresponding values ("\u03b1\u03b2\u03b3...").

Yes it looks like Greek-Greeklish has been done many times before:

http://www.google.com/search?q=greek+greeklish+conversion
http://www.translatum.gr/converter/greeklish-converter.htm
http://ncnever.free.fr/translit/
http://speech.ilsp.gr/greeklish/greeklishdemo.asp
But I hoped I could skip the second by a computation, f.e. "g" has
index 2 in the first array, so output "\u03b1"+2.

This does not work (of course). But do I have a chance to "compute"
the output value?

Considering the character conversions at
http://www.translatum.gr/converter/greek-transliteration.htm
I think you need a lookup-table anyhow.

Hope this helps,
 

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,774
Messages
2,569,598
Members
45,157
Latest member
MercedesE4
Top