<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I was reading an article about PHP and MySQL and UTF-8 encoding
after having some issues on some pages. They recommend adding the
following entries in your my.cnf file:<br>
<br>
<pre style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(48, 48, 48); font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"><code class=" hljs sql" style="margin: 0px; padding: 2px 5px; border: 1px solid rgb(238, 238, 238); vertical-align: text-bottom; min-height: 0px; min-width: 0px; box-sizing: border-box; display: inline-block; color: rgb(101, 123, 131); border-radius: 3px; font-family: monospace; font-size: 0.8em; line-height: 1.5em; max-width: 100%; width: 834px; overflow-x: auto; background: rgb(255, 255, 252);"> [client]
default-character-<span class="hljs-operator" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box;"><span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">set</span>=UTF-<span class="hljs-number" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(42, 161, 152);">8</span>
[mysql]
<span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">default</span>-<span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">character</span>-<span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">set</span>=UTF-<span class="hljs-number" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(42, 161, 152);">8</span>
[mysqld]
<span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">character</span>-<span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">set</span>-client-handshake = <span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">false</span> #force encoding <span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">to</span> uft8
<span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">character</span>-<span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">set</span>-server=UTF-<span class="hljs-number" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(42, 161, 152);">8</span>
<span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">collation</span>-server=UTF-<span class="hljs-number" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(42, 161, 152);">8</span>_general_ci
[mysqld_safe]
<span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">default</span>-<span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">character</span>-<span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(133, 153, 0);">set</span>=UTF-<span class="hljs-number" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; min-height: 0px; min-width: 0px; box-sizing: border-box; color: rgb(42, 161, 152);">8</span></span></code></pre>
<br>
Is it safe to add these entries into the my.cnf file via the GUI's
MySQL Config my.cnf editor? My current file only has [mysqld] and
[mysqld_safe] blocks. And will saving it there restart MySQL? (I'm
running 5108R for now).<br>
<br>
FYI, in the mysql CLI I get this right now:<br>
<br>
<br>
mysql> show variables like 'char%';<br>
+--------------------------+----------------------------+<br>
| Variable_name | Value |<br>
+--------------------------+----------------------------+<br>
| character_set_client | utf8 |<br>
| character_set_connection | utf8 |<br>
| character_set_database | latin1 |<br>
| character_set_filesystem | binary |<br>
| character_set_results | utf8 |<br>
| character_set_server | latin1 |<br>
| character_set_system | utf8 |<br>
| character_sets_dir | /usr/share/mysql/charsets/ |<br>
+--------------------------+----------------------------+<br>
<pre class="moz-signature" cols="72">
-jim
</pre>
</body>
</html>