Re: Numeric equivalents of characters
Posted by: Rick James
Date: October 01, 2014 12:24AM

mysql> SELECT ord(convert('א' using ucs2));
+-------------------------------+
| ord(convert('א' using ucs2))  |
+-------------------------------+
|                          1488 |
+-------------------------------+
1 row in set (0.00 sec)

To explain:
* ucs2 is the CHARACTER SET that matches Unicode.
* CONVERT() changes Aleph from whatever CHARACTER SET you are in (utf8, in my case) to what it says (ucs2).
* ORD() converts one _character_ (not one _byte_) to decimal.
* If you want HEX, then enclose that in HEX().

(P is 80, not 77 in most encodings.)

Options: ReplyQuote


Subject
Views
Written By
Posted
2612
September 29, 2014 05:09PM
Re: Numeric equivalents of characters
1308
October 01, 2014 12:24AM
1304
October 01, 2014 11:16PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.