There is a string "\ x3a1" How can I determine which character is meant? in the source line, the conversion looks like this: ": 1", but there is after all the code "\ x3a1", meaning the symbol 'Ρ' (Greek Capital Letter Rho)
- Uh ... Where did the question rewrite? I have the answer ready. - Qwertiy ♦
- :) I understood just what was wrong and I had a second question how to create an array or regular routine for isolating character codes for conversion, an example from the question - Vasily
- No need to convert anything, just use utf8. - Qwertiy ♦
|
1 answer
You get it wrong. In js, characters with codes 256 and no longer are written in \x
, they are written in \u
, and exactly 4 digits. Well, or with braces. And your \x301
is 2 characters - \x30
and just 1
.
<p>Ρ</p> <p><script>document.write("\u03a1")</script></p> <p><script>document.write("\x3a1")</script></p> <p><script>document.write("\u{3a1}")</script></p>
|