<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум PHP-MyAdmin.RU &mdash; Проблемы с кириллицей]]></title>
	<link rel="self" href="https://forum.php-myadmin.ru/extern.php?action=feed&amp;tid=754&amp;type=atom" />
	<updated>2008-04-18T21:10:29Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.php-myadmin.ru/viewtopic.php?id=754</id>
		<entry>
			<title type="html"><![CDATA[Re: Проблемы с кириллицей]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=4823#p4823" />
			<content type="html"><![CDATA[<p><strong>farrow</strong><br />Да, странно. А сам php файл со скриптом в ANSI, а то может он случайно в UTF-8 сохранился?</p>]]></content>
			<author>
				<name><![CDATA[Hanut]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=181</uri>
			</author>
			<updated>2008-04-18T21:10:29Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=4823#p4823</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Проблемы с кириллицей]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=4822#p4822" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Hanut сказал:</cite><blockquote><p>Что выдает запрос?<br /></p><div class="codebox"><pre><code>SHOW CREATE TABLE `adminka`;</code></pre></div><p>Возможно, из-за использования командной строки, таблица создалась в кодировке cp866.<br />Чтобы не мучиться с кодировками, используйте phpMyAdmin, так как в нем все очевидно.</p></blockquote></div><p>mysql&gt; SHOW CREATE TABLE `adminka`;<br />+---------+---------------------------------------------------------------------<br />------------------------------------------------------------------------------+<br />| Table&nbsp; &nbsp;| Create Table<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />+---------+---------------------------------------------------------------------<br />------------------------------------------------------------------------------+<br />| adminka | CREATE TABLE `adminka` (<br />&nbsp; `title` char(255) NOT NULL,<br />&nbsp; `referat` text NOT NULL,<br />&nbsp; PRIMARY KEY&nbsp; (`title`)<br />) ENGINE=MyISAM DEFAULT CHARSET=cp1251 |<br />+---------+---------------------------------------------------------------------<br />------------------------------------------------------------------------------+<br />1 row in set (0.00 sec)</p><p>В my.ini у меня есть запись:<br />init-connect=&quot;SET NAMES cp1251&quot;</p>]]></content>
			<author>
				<name><![CDATA[farrow]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=1250</uri>
			</author>
			<updated>2008-04-18T19:10:53Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=4822#p4822</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Проблемы с кириллицей]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=4821#p4821" />
			<content type="html"><![CDATA[<p>Что выдает запрос?<br /></p><div class="codebox"><pre><code>SHOW CREATE TABLE `adminka`;</code></pre></div><p>Возможно, из-за использования командной строки, таблица создалась в кодировке cp866.<br />Чтобы не мучиться с кодировками, используйте phpMyAdmin, так как в нем все очевидно.</p>]]></content>
			<author>
				<name><![CDATA[Hanut]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=181</uri>
			</author>
			<updated>2008-04-18T17:13:59Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=4821#p4821</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Проблемы с кириллицей]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=4820#p4820" />
			<content type="html"><![CDATA[<p>У меня какая-то аномальная проблема с MySQL (5 версия). </p><p>Если с помощью INSERT вставлять данные на русском языке (в консоле) - все идеально записывается в таблицу. Потом также идеально с помощью SELECT из нее вытаскивается (тоже в консоле).</p><p>Если я пытаюсь добавить кириллицу через php - она у меня просто не сохраняется. Я прочел много топиков, где у людей кириллица записывается неправильно (вопросиками например). У меня же она вообще через php не записывается. Хотя английский текст нормально сохраняется. Вот код, с помощью которого я это делаю:</p><p>&lt;?php<br />&nbsp; $title = &#039;поцфшопшщфцощпфцпфцп&#039;;<br />&nbsp; $content = &#039;опфцзщщзщпфцпфцпфцпфп&#039;;<br />&nbsp; &nbsp;require(&#039;config.php&#039;); // из этого файла загружается данные для подключения<br />&nbsp; &nbsp;$db = new mysqli($database, $login, $password, &#039;yaparser&#039;);<br />&nbsp; &nbsp; &nbsp; if (get_magic_quotes_gpc())<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $title = stripslashes($title);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $content = stripslashes($content);<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp;else<br />&nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $title = $db -&gt; real_escape_string($title);<br />&nbsp; &nbsp; &nbsp; &nbsp; $content = $db -&gt; real_escape_string($content); <br />&nbsp; &nbsp; &nbsp; } <br />&nbsp; &nbsp; $query = &quot;insert into adminka values (&#039;&quot;.$title.&quot;&#039;, &#039;&quot;.$content.&quot;&#039;)&quot;;<br />&nbsp; &nbsp; $result = $db-&gt;query($query);<br />&nbsp; &nbsp; $db-&gt;close();<br />?&gt;</p><p>А вот такая вот у меня таблица:</p><p>create table adminka<br />( title char(255) not null primary key,<br />&nbsp; referat text not null<br />);</p><p>А это данные о кодировке MySQL:</p><p>mysql&gt; show variables like &#039;character%&#039;;<br />+--------------------------+----------------------------------------------------<br />-----+<br />| Variable_name&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Value<br />&nbsp; &nbsp; &nbsp;|<br />+--------------------------+----------------------------------------------------<br />-----+<br />| character_set_client&nbsp; &nbsp; &nbsp;| cp1251<br />&nbsp; &nbsp; &nbsp;|<br />| character_set_connection | cp1251<br />&nbsp; &nbsp; &nbsp;|<br />| character_set_database&nbsp; &nbsp;| cp1251<br />&nbsp; &nbsp; &nbsp;|<br />| character_set_filesystem | binary<br />&nbsp; &nbsp; &nbsp;|<br />| character_set_results&nbsp; &nbsp; | cp1251<br />&nbsp; &nbsp; &nbsp;|<br />| character_set_server&nbsp; &nbsp; &nbsp;| cp1251<br />&nbsp; &nbsp; &nbsp;|<br />| character_set_system&nbsp; &nbsp; &nbsp;| utf8<br />&nbsp; &nbsp; &nbsp;|<br />| character_sets_dir&nbsp; &nbsp; &nbsp; &nbsp;| C:\Program Files\MySQL\MySQL Server 5.0\share\chars<br />ets\ |<br />+--------------------------+----------------------------------------------------<br />-----+<br />8 rows in set (0.02 sec)</p><p>Что можно попробовать предпринять?</p>]]></content>
			<author>
				<name><![CDATA[farrow]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=1250</uri>
			</author>
			<updated>2008-04-18T14:40:40Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=4820#p4820</id>
		</entry>
</feed>
