MySQL Forums
Forum List  »  PHP

Re: How setting coexist EUC and UTF8 ?(Windows7)
Posted by: Rick James
Date: February 09, 2013 05:47PM

http://mysql.rjweb.org/doc.php/charcoll

SET NAMES according to the encoding being used by the _client_ (not the table).

Use the SELECT HEX() technique (in my link) to make sure the table is correct.

Which of these are you talking about?

mysql> SHOW COLLATION LIKE '%euc%';
+---------------------+---------+----+---------+----------+---------+
| Collation           | Charset | Id | Default | Compiled | Sortlen |
+---------------------+---------+----+---------+----------+---------+
| euckr_korean_ci     | euckr   | 19 | Yes     | Yes      |       1 |
| euckr_bin           | euckr   | 85 |         | Yes      |       1 |
| eucjpms_japanese_ci | eucjpms | 97 | Yes     | Yes      |       1 |
| eucjpms_bin         | eucjpms | 98 |         | Yes      |       1 |
+---------------------+---------+----+---------+----------+---------+
4 rows in set (0.00 sec)

mysql> SHOW COLLATION LIKE '%jis%';
+------------------+---------+----+---------+----------+---------+
| Collation        | Charset | Id | Default | Compiled | Sortlen |
+------------------+---------+----+---------+----------+---------+
| ujis_japanese_ci | ujis    | 12 | Yes     | Yes      |       1 |
| ujis_bin         | ujis    | 91 |         | Yes      |       1 |
| sjis_japanese_ci | sjis    | 13 | Yes     | Yes      |       1 |
| sjis_bin         | sjis    | 88 |         | Yes      |       1 |
+------------------+---------+----+---------+----------+---------+
4 rows in set (0.00 sec)
I assume eucjpms and ujis, correct? I am not familiar with either encoding, but I suspect they are exactly 2 bytes per character? Or do they include 1-byte Romanji characters?
Use the SELECT LENGTH(), CHAR_LENGTH() technique to verify that the ration is 2 or slightly less. If it is about 4, you may have a "double encoding" problem, meaning that the table is corrupted.

Options: ReplyQuote


Subject
Written By
Posted
Re: How setting coexist EUC and UTF8 ?(Windows7)
February 09, 2013 05:47PM


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.