MySQL Forums
Forum List  »  General

Re: MySQL ASCII codes
Posted by: Frederic Descamps
Date: January 09, 2019 02:08AM

Hi Cándido,

The ord() function in MySQL behaves differently regarding your charset (see https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_ord).

But if you want to achieve what you are trying to do, here is one method:

mysql> SELECT ord(CAST('à' AS CHAR CHARACTER SET latin1));
+----------------------------------------------+
| ord(CAST('à' AS CHAR CHARACTER SET latin1)) |
+----------------------------------------------+
| 224 |
+----------------------------------------------+
1 row in set (0.00 sec)

Best regards and thank you for using MySQL!

lefred.

Options: ReplyQuote


Subject
Written By
Posted
January 08, 2019 07:59PM
January 08, 2019 10:47PM
Re: MySQL ASCII codes
January 09, 2019 02:08AM


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.