Today, I wrote a group buying website trainer who used the S2SH big integration. It was a bit exciting, but there were a lot of troubles. After all, what I did for the first time? This log is about a big acquaintance, incorrect string value:
Write a process to dynamically call the queried field and the string value in the where condition, where string
Take the emp table in scott user as an example to compile a stored procedure to query the values of a field in the emp table. However,
Recently, I used an XML file to send a stream file to insert it into the database. It took a long time to locate the bug because of intermediate encryption, transcoding, and a bunch of operations, the final reason is that the table creation brothers
Previously thought from top to bottom unified use of UTF-8 on the rest of the peace of mind, which knows today in the capture of Sina Weibo data or encounter character exceptions.
An exception is thrown when the data captured from Sina Weibo is
Session, the string value obtained, always gets the images type using the ci framework, version 2.1.4
$ Uuid = (string) ($ this-> uri-> segment (3 ));
$ Data = array (
'Uuid' => $ uuid
);
$ This-> session-> set_userdata ('uuid', $ data );
Emoji expression characters are now widely supported in app. But MySQL's UTF8 code does not support emoji characters as well. So we are often confronted with exceptions like this:
Incorrect string value: ' \xf0\x90\x8d\x83 ... ' for column
The
Org.springframework.beans.factory.BeanDefinitionStoreException:Invalid Bean definition with name ' DataSource ' defined in file [D:\Workspaces\MyEclipse 10\springjdbc2\bin\applicationcontext.xml]: Could not resolve placeholder ' Jdbc.driverclassname
Today, while climbing the NetEase Cloud music song commentary, when inserting data into the MySQL database, incorrect string value: ' \xf0\x9f\x98\xad ',... ' for column ' commentcontent ' Row 1 This error, Google found that the original is due to
Previously thought that from the top to the next unified use of UTF-8 on the rest of the peace of the day, but today in the crawl Sina Weibo data is still encountered the exception of characters.
The data captured by Sina Weibo throws an exception
1. Explanation:
This is a custom mysq error that is reported at run time
function of 2.Mysql:
CREATE FUNCTION ' getclassname ' (classId INTEGER)RETURNS varchar (CHARSET) UTF8DeterministicBEGINDECLARE cName VARCHAR () DEFAULT ';SELECT ' name '
ERROR 1366 (HY000): Incorrect string value: ' XXX ' for column ' xxx at row 1 resolves
Environment
MySQL Server 5.5.27 + command line tools
Problem
The following error occurred in the insert Chinese character data:
ERROR 1366 (HY000): Incorrect
Problem description: From Sina Weibo crawl message saved to MySQL data, corresponding database field is varchar, character encoding utf-8. Partial insert succeeded, partial insert failed, error such as title.In the online query, some people say that
Problem description: From Sina Weibo crawl message saved to MySQL data, corresponding database field is varchar, character encoding utf-8. Partial insert succeeded, partial insert failed, error such as title.In the online query, some people say that
Error reason: We can see the character 0xf0 0x9F 0x98 0x84 in the error prompt, which corresponds to the 4-byte encoding in the UTF-8 encoding format (UTF-8 encoding specification). Normal Chinese characters generally don't exceed 3 bytes, why do
1. Cause of Error:The MySQL utf-8 code stores 2-3 bytes, while emoji is 4 bytes.2. Workaround:Modify the MySQL configuration file, under Windows for My.ini (Linux for my.cnf), the same content is modified.[Client]default-character-set =
Problem description: From Sina Weibo crawl message saved to MySQL data, the corresponding database field varchar, character encoding utf-8. Partial insert succeeded, partial insert failed, error as title.
In the online query, some people say is the
Insert Chinese character times through JDBC to MySQL this is a mistake.Solution:1, the Database and table coding to Utf-8
ALTER TABLE address convert to character set UTF82, Vim/etc/my.cnf joined
Strcmp (); does the function compare the value of a string or the length of a string? Come on, let me know. I admit that I am too lazy to try it. ------ Solution ---------------------- compare values. of course, if the length is different, you do
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.