MySQL Forums
Forum List  »  Newbie

Re: HexDumped Binlogs
Posted by: Rick James
Date: August 15, 2014 06:33PM

Bad news. The "code page" is not the same as MySQL's "latin1".
mysql> SELECT HEX(CONVERT('ü' USING latin1));
+---------------------------------+
| HEX(CONVERT('ü' USING latin1))  |
+---------------------------------+
| FC                              | -- not 81
+---------------------------------+

Do
SHOW COLLATION LIKE '%cp%';
On my machine, I get
+----------------------+---------+----+---------+----------+---------+
| Collation            | Charset | Id | Default | Compiled | Sortlen |
+----------------------+---------+----+---------+----------+---------+
| cp850_general_ci     | cp850   |  4 | Yes     | Yes      |       1 |
| cp850_bin            | cp850   | 80 |         | Yes      |       1 |
(and lots more)

mysql> SELECT HEX(CONVERT('ü' USING cp850));
+--------------------------------+
| HEX(CONVERT('ü' USING cp850))  |
+--------------------------------+
| 81                             | -- which is what you have
+--------------------------------+
This is encouraging.

Where am I heading?
* I believe your data was stored as cp850, but in a "latin1" field. Latin1 is forgiving (arguably, too forgiving).
* We need to find a way to either
** Change the characterset to cp850 (caution! obvious attempts will convert the data!), or
** Change the encoding to be latin1. (But that messes up with your use of the Codepage.)

Do you have a spare machine on which to test things? If not, create a new database and do some testing there.

Decide which you want to do while I experiment with the details of the two approaches (convert the data vs convert the character set).
**

Options: ReplyQuote




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.