Re: Characters not getting stored
Posted by: Rick James
Date: April 05, 2013 11:07PM

> and it is now stored and showing up properly, although damn me if I understand why.

Believe me, I have felt that way many times while writing that doc. (Usually it was "Damn it! I thought that combination would work!")

Your thread has prompted me to think of the issue from a different point of view. I hope to add yet another section to the doc, this time suggesting that the "solution" usually comes from knowing what encoding you have to start with.

These should be the only ones that matter:
| character_set_client | utf8
| character_set_connection | utf8
| character_set_results | utf8
Those are the 3 that are modified by SET NAMES.

I've never dealt with cp850, so I am peeking at http://en.wikipedia.org/wiki/Code_page_850 to follow what you are saying.

I see that E1 is the (1-byte) encoding for 'ß'.
2.1 implies (I hope) that whatever you are doing to get the sharp-s, it is encoded cp850. I assume you did SELECT 'ß', hex('ß');
2.2 (NAMES latin1) does not prove much, since latin1 doesn't do much.
2.3 (Names utf8) -- are you saying it still says E1 for hex('ß')? Grrr... I can't explain that.
2.7-15 dutifully convert it to the expected 2- and 1-byte hex encodings. Good.

> and only with the files saved as ANSI

Something's gotta give -- there is no 'ß' in ASCII.

> name_de like 'Ä%' I get also those that starts with regular 'A'

Now you are getting into the world of "collations". Any collation name ending with _ci will equate Ä, A, a, ring-a, etc. For example (from the doc):
utf8_general_ci A=a=À=Á=Â=Ã=Ä=Å=à=á=â=ã=ä=å ...
shows that 14 characters are treated as "equal" by utf8_general_ci.

You may need utf8_bin, which would treat all 14 as different. (There is no case-fold-but-accent-sensitive collation for utf8 or cp850.)

Perhaps the  is in a city name in Bavaria? Wikipedia says "[Â] is part of the alphabets used for the Alemannic and the Bavarian-Austrian dialects of German." -- http://en.wikipedia.org/wiki/A-ring

Options: ReplyQuote


Subject
Views
Written By
Posted
4519
April 02, 2013 01:19PM
1684
April 04, 2013 07:48PM
1952
April 05, 2013 01:00AM
Re: Characters not getting stored
1810
April 05, 2013 11:07PM


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.