<?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>文字化け | ウダ2Blog</title>
	<atom:link href="https://uda2.com/blog/tag/%e6%96%87%e5%ad%97%e5%8c%96%e3%81%91/feed/" rel="self" type="application/rss+xml" />
	<link>https://uda2.com/blog</link>
	<description>大阪でフリーランスとしてWEB制作している管理人が気になった技術をメモったり、作ったツールの紹介などを綴っているブログです。</description>
	<lastBuildDate>Thu, 26 Feb 2015 07:30:59 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>MovableTypeをXREAからCORE SERVERへ</title>
		<link>https://uda2.com/blog/movabletype-2/</link>
					<comments>https://uda2.com/blog/movabletype-2/#respond</comments>
		
		<dc:creator><![CDATA[uda2]]></dc:creator>
		<pubDate>Tue, 26 Jan 2010 09:14:53 +0000</pubDate>
				<category><![CDATA[うだうだ]]></category>
		<category><![CDATA[CORE SERVER]]></category>
		<category><![CDATA[MovableType]]></category>
		<category><![CDATA[MYSQL]]></category>
		<category><![CDATA[文字化け]]></category>
		<guid isPermaLink="false">http://uda2.com/blog/?p=920</guid>

					<description><![CDATA[<p>仕事の仮アップ用にMovableTypeもインストールしていたが先日のXREAからCORE SERVERへ移転でMySQLのデータが上手くバックアップできなかった。 まず、PhpMyAdminでバックアップしたデータが’</p>
The post <a href="https://uda2.com/blog/movabletype-2/">MovableTypeをXREAからCORE SERVERへ</a> first appeared on <a href="https://uda2.com/blog">ウダ2Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>仕事の仮アップ用にMovableTypeもインストールしていたが先日のXREAからCORE SERVERへ移転でMySQLのデータが上手くバックアップできなかった。<br />
まず、PhpMyAdminでバックアップしたデータが’（シングルコーテーション）が2重になってたり、表示などの文字に￥マークが付いたりしていた。<br />
どう書き出しても同じ結果なので仕方なくエディタで検索しながら手作業でエラーが出ない形に整形して読み込ませた。何度か挑戦するとようやく読み込みに成功した。<br />
MovableTypeを立ち上げて、管理画面を開くと文字化けだらけ。念のためPhpMyAdminでデータを確認したが正常に表示される。<br />
前回の<a href="http://uda2.com/blog/2010/01/core-server%e3%81%a7mysql%e3%81%ae%e6%96%87%e5%ad%97%e5%8c%96%e3%81%91/" target="_blank">CORE SERVERでMySQLの文字化け</a>と同じ現象だ、MySQL4（XREA）からMySQL5（CORE SERVER）に移転したのが原因だと思われる。<br />
前回はPHPだったのでセーフティな対処法があったが、MovableTypeはPERLなので同じ事は出来ない。<br />
/mt/lib/MT/ObjectDriver/DBI/mysql.pm<br />
に<br />
$driver->{dbh}->do(&#8220;SET NAMES sjis&#8221;);<br />
を3箇所ぐらいに記載して無理矢理文字化けしないようにしたが、後で調べてみると<a href="http://www.my-chicken-heart.com/2008/01/xreamysql5movable_type4.html" target="_blank">XREAのサーバーでMySQL5を使っているとMovable Type4をインストールするとそれまで使っていたデータベースのデータが文字化けするようだ。</a>という記事を発見した。<br />
/mt/mt-config.cgi<br />
で<br />
SQLSetNames 1<br />
とするだけで良かったみたい。<br />
「mysql.pm」を元に戻して「mt-config.cgi」を修正したらすんなり表示できた。<br />
ソースを見る限りやることは同じだけど、オフィシャルのやり方なのでコッチの方が安心だ。</p>The post <a href="https://uda2.com/blog/movabletype-2/">MovableTypeをXREAからCORE SERVERへ</a> first appeared on <a href="https://uda2.com/blog">ウダ2Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://uda2.com/blog/movabletype-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>CORE SERVERでMySQLの文字化け</title>
		<link>https://uda2.com/blog/core-server%e3%81%a7mysql%e3%81%ae%e6%96%87%e5%ad%97%e5%8c%96%e3%81%91/</link>
					<comments>https://uda2.com/blog/core-server%e3%81%a7mysql%e3%81%ae%e6%96%87%e5%ad%97%e5%8c%96%e3%81%91/#comments</comments>
		
		<dc:creator><![CDATA[uda2]]></dc:creator>
		<pubDate>Fri, 22 Jan 2010 00:47:54 +0000</pubDate>
				<category><![CDATA[うだうだ]]></category>
		<category><![CDATA[CORE SERVER]]></category>
		<category><![CDATA[MYSQL]]></category>
		<category><![CDATA[文字化け]]></category>
		<guid isPermaLink="false">http://uda2.com/blog/?p=910</guid>

					<description><![CDATA[<p>作業量を計る為に日報を書くプログラム（PHP＋MySQL）を作っていたが、今回のXREAからCORE SERVERの引っ越しで文字化したので調べてみた。 PhpMyAdminから入力した文章は自作PHPで文字化けし、 自</p>
The post <a href="https://uda2.com/blog/core-server%e3%81%a7mysql%e3%81%ae%e6%96%87%e5%ad%97%e5%8c%96%e3%81%91/">CORE SERVERでMySQLの文字化け</a> first appeared on <a href="https://uda2.com/blog">ウダ2Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>作業量を計る為に日報を書くプログラム（PHP＋MySQL）を作っていたが、今回のXREAからCORE SERVERの引っ越しで文字化したので調べてみた。<br />
PhpMyAdminから入力した文章は自作PHPで文字化けし、<br />
自作PHPから入力した文章はPhpMyAdminで文字化けしてる状態だ。<br />
最初は明らかに古いPhpMyAdminがインストールされたので怪しいと思ってバージョンアップしてみたが何も変わらない。phpinfoとかも見てみたが大丈夫だ残るはmySQL。telnetでログインして文字コードが何なのか調べてみる事にした。</p>
<pre><code>&gt; cd /
&gt; mysql -u ユーザー名 -p
mysql&gt; SHOW VARIABLES LIKE 'cha%';
+--------------------------+---------------------------------------------------+
| Variable_name            | Value                                             |
+--------------------------+---------------------------------------------------+
| character_set_client     | latin1                                            |
| character_set_connection | latin1                                            |
| character_set_database   | utf8                                              |
| character_set_filesystem | binary                                            |
| character_set_results    | latin1                                            |
| character_set_server     | utf8                                              |
| character_set_system     | utf8                                              |
| character_sets_dir       | /usr/local/mysql-src-5.1.22/share/mysql/charsets/ |
+--------------------------+---------------------------------------------------+</code></pre>
<p>とlatin1（ラテン）が混じっていた。もちろん管理画面からmySQLを作成する時にUNICODEで作成してる。<br />
一体何を考えてlatin1のまま放置してるのか分からないが、共用サーバーではこの設定を変える事は出来ない。<br />
検索するとset names utf8以外の文字化け対策ってのを見つけた。<br />
CORE SERVERはPHP5.2.5なので<br />
mysql_set_charset(&#8216;utf8&#8217;);<br />
を追記した。するとバッチリ直った。<br />
ただ、毎回CORE SERVERの為だけにコレを書く必要があるしオープンソースなソフトをインストールする時にややこしい事になりそうだ。</p>The post <a href="https://uda2.com/blog/core-server%e3%81%a7mysql%e3%81%ae%e6%96%87%e5%ad%97%e5%8c%96%e3%81%91/">CORE SERVERでMySQLの文字化け</a> first appeared on <a href="https://uda2.com/blog">ウダ2Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://uda2.com/blog/core-server%e3%81%a7mysql%e3%81%ae%e6%96%87%e5%ad%97%e5%8c%96%e3%81%91/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>波線と全角チルダ</title>
		<link>https://uda2.com/blog/post_41/</link>
					<comments>https://uda2.com/blog/post_41/#respond</comments>
		
		<dc:creator><![CDATA[uda2]]></dc:creator>
		<pubDate>Tue, 02 Sep 2008 13:38:13 +0000</pubDate>
				<category><![CDATA[制作日記]]></category>
		<category><![CDATA[文字化け]]></category>
		<category><![CDATA[機種依存文字]]></category>
		<guid isPermaLink="false">http://uda2.com/wordpress/2008/09/post_41.html</guid>

					<description><![CDATA[<p>機種依存文字で今まで使えなかった丸文字やローマ数字などがユニコードのおかげで文字化けせずに使える様になった。（とはいえ、MSゴシックでは文字がつぶれて読めない場合が多いが・・・） 但し、ユニコードに対応していてフォントに</p>
The post <a href="https://uda2.com/blog/post_41/">波線と全角チルダ</a> first appeared on <a href="https://uda2.com/blog">ウダ2Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>機種依存文字で今まで使えなかった丸文字やローマ数字などがユニコードのおかげで文字化けせずに使える様になった。（とはいえ、MSゴシックでは文字がつぶれて読めない場合が多いが・・・）<br />
但し、ユニコードに対応していてフォントに使用する文字がフォントにその文字がある必要があるが、ユニコードに対応してないとブログが見れないって事になるのでそんなブラウザを使用している人も少ないだろう（携帯を除く）、フォントの問題も余程変わった文字を使わない限りあると思うが、殆どのサイトは機種依存文字を避けているのが現状だ。<br />
ただ、ユニコードのおかげで波線（&#x301C;：&amp;#x8160;）と全角チルダ（～：&amp;#xFF5E;）の区別が出来て、その文字を使うとShift-JISやEUCなんかで文字化けする事が起きた。<br />
そもそも、全角チルダはあくまでチルダ（~）の全角バージョンなので「オラ～～」とかの使い方は間違いで「オラ&#x301C;&#x301C;」が正解らしい、「東京～大阪」も間違いで「東京&#x301C;大阪」が正解。<br />
何故こんな間違いになったかというとWindowsやMac（OS9）で使用されている文字コード（Shift-JIS）には波線が無いから全角チルダを使っていたのが原因なのだがOSXになり文字コードがユニコードになったので正しく波線を入力する人が現れた為、混在する事になった。<br />
波線の方が正しいのかもしれないが文字化けする可能性があるし、MSゴシックでは汚く表示されるので全角チルダに統一して欲しい。</p>The post <a href="https://uda2.com/blog/post_41/">波線と全角チルダ</a> first appeared on <a href="https://uda2.com/blog">ウダ2Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://uda2.com/blog/post_41/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
