MySQL Forums
Forum List  »  PHP

Re: Newby needs some help - collation/charset ?
Posted by: Rick James
Date: December 18, 2013 06:28PM

> 'Passt übergroße ...
> mySQL error: Incorrect string value: '\xFCbergr...' for column 'sub_title' at row 1

Good info. Now, notice that hex FC in
http://mysql.rjweb.org/doc.php/charcoll#8_bit_encodings
is the 'ü' of 'übergroße'.
This says that the FC is latin1, not utf8.

Plan A:
Do "SET NAMES latin1" or mysqli_set_charset('latin1'); that will tell the connection that your data is in latin1, and to convert (if necessary) to/from the datatype associated with the column being INSERTed or SELECTed.

Plan B:
Arrange for the data you have ('Passt übergroße ...') to be in utf8 encoding.

We still need to see what got into the database table. I suspect that this string was truncated to 'Passt ' as it was inserted.

The German sharp-s has a shaky history. See
http://mysql.rjweb.org/doc.php/charcoll#german_sharp_s_
(That section is probably not important in your case.)

I'm sorry that that web page is so long. I have not figured out how to make it both shorter and applicable to everyone.

Options: ReplyQuote


Subject
Written By
Posted
Re: Newby needs some help - collation/charset ?
December 18, 2013 06:28PM


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.