![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
On Feb 3, 8:16 pm, Thomas 'PointedEars' Lahn <PointedE... (AT) web (DOT) de wrote: VK wrote: Javascript operates only and exclusively with Unicode (note UTF-8) but Unicode itself. That is incoherent gibberish, and qualifies as nonsense. Oh com'on, these are really ground basics. *These* are not, because what you said is nonsense at best. What exactly you did not understand in my explanations? |
#12
| |||
| |||
|
|
To explain it in more detail. There is a javascript SDK plug-in in FARR ( http://www.donationcoder.com/Forums/...?topic=11804.0 ). It uses Microsoft scripting host to interpret javascript. I would like to display unicode result (russian, greek etc) as RTF1 which means that I have to convert ěščřž etc. to its decimal interpretation by charCodeAt. So when I call the charCodeAt for the letter "č" the SDK displays 356 but it should be 269. |
|
Do you think there might be an error in the javascript SDK plug-in? |
|
And concerning the function. It is what I have found on the internet. I an javascript newbie ![]() |
#13
| |||
| |||
|
|
czechboy <oldrich.s... (AT) gmail (DOT) com> writes: To explain it in more detail. There is a javascript SDK plug-in in FARR (http://www.donationcoder.com/Forums/...?topic=11804.0 ). It uses Microsoft scripting host to interpret javascript. I would like to display unicode result (russian, greek etc) as RTF1 which means that I have to convert etc. to its decimal interpretation by charCodeAt. So when I call the charCodeAt for the letter "" the SDK displays 356 but it should be 269. I would expect MS jscript to do something as basic as charcodeat correctly. My implementation (firefox) correctly gives 268 (0x10c) for "". In any case it's more likely that the text is wrongly converted somewhere before it reaches the script (i.e. converted from an encoding that it's not in fact in). Do you think there might be an error in the javascript SDK plug-in? Could be. From your URL it appears that the host isn't unicode aware. And concerning the function. It is what I have found on the internet. I an javascript newbie ![]() Don't use it. it's incorrect. Joost. |
Thank
#14
| |||
| |||
|
|
charCodeAt already returns the unicode codepoint and strings in javascript are unicode. The conversion to and from other encodings is presumably handled by the scripting host (i.e. the browser). |
#15
| |||
| |||
|
|
Thank you for your help. Now it is working. Could you please post me correct function? I am not that skilled to do one by myself Thankyou |
#16
| |||
| |||
|
|
czechboy <oldrich.s... (AT) gmail (DOT) com> writes: Thank you for your help. Now it is working. Could you please post me correct function? I am not that skilled to do one by myself Thankyou I think Thomas already posted a correction to the function in this thread. Look it up. Joost. |
![]() |
| Thread Tools | |
| Display Modes | |
| |