Jump to content
php.lv forumi

utf8 vai utf-8?


shurix

Recommended Posts

Tev pienākas vēlviens jautājums.

Funkcionalitātes ziņā ar ko atšķiras?

Lieta tāda ka parasti man lapā ir SET NAMES 'utf-8 variants, bet nupat vajadzēja no phpbb foruma izvilkt informāciju, bet viņam kodējums ir "SET NAMES 'utf8'" un līdz ar to garumzīmju un krievu valodas vieta radas ķeburi.

Edited by shurix
Link to comment
Share on other sites

Kāpēc gan pašam neizlasīt oficiālu dokumentāciju?

Character Sets and Collations That MySQL Supports

+----------+-----------------------------+---------------------+
| Charset  | Description                 | Default collation   |
+----------+-----------------------------+---------------------+
...
| utf8     | UTF-8 Unicode               | utf8_general_ci     |

 

Un kāpēc galu galā pašam nepamēģināt izpildīt abus kverijus:

mysql> set names 'utf-8';
ERROR 1115 (42000): Unknown character set: 'utf-8'
mysql> set names 'utf8';
Query OK, 0 rows affected (0.00 sec)

 

Secinājumi? Tu savam set names 'utf-8' kverijam nepārbaudi atgriežāmo kļūdu:

mysql_query("set names 'utf-8'") or die(mysql_error());

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...