<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>UTF-8 &#8211; richliu&#039;s blog</title>
	<atom:link href="https://richliu.com/tag/utf-8/feed/" rel="self" type="application/rss+xml" />
	<link>https://richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Sun, 12 May 2024 08:56:00 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Python mysql.connector.errors.DataError: 1366 (22007): Incorrect string value:</title>
		<link>https://richliu.com/2024/05/12/5973/python-mysql-connector-errors-dataerror-1366-22007-incorrect-string-value/</link>
					<comments>https://richliu.com/2024/05/12/5973/python-mysql-connector-errors-dataerror-1366-22007-incorrect-string-value/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 12 May 2024 08:55:58 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[UTF-8]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5973</guid>

					<description><![CDATA[<p>After check all mysql (mariadb) setting, I realize that [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/05/12/5973/python-mysql-connector-errors-dataerror-1366-22007-incorrect-string-value/">Python mysql.connector.errors.DataError: 1366 (22007): Incorrect string value:</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>After check all mysql (mariadb) setting, I realize that should be client issue, it needs to add &#8220;chatset=&#8217;utf8mb4&#8242;&#8221; to mysql.connector.connect command. </p>



<pre class="wp-block-preformatted">mydb = mysql.connector.connect(
    host="IP or Host",
    user="&lt;user>",
    passwd="&lt;password>",
    database="&lt;yourDB>",
    # set charset to utf8mb4 to support emojis
    charset='utf8mb4'
)</pre>



<p>ref. https://stackoverflow.com/a/73648817/1371373</p>



<p></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/05/12/5973/python-mysql-connector-errors-dataerror-1366-22007-incorrect-string-value/">Python mysql.connector.errors.DataError: 1366 (22007): Incorrect string value:</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2024/05/12/5973/python-mysql-connector-errors-dataerror-1366-22007-incorrect-string-value/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
