Re: Problem with arabic charset
Posted by: Felipe Arias
Date: February 08, 2011 11:08PM

mysql> set names utf8;
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT `title`, HEX(title), LENGTH(title), CHAR_LENGTH(title) FROM forum where forumid=9;
+-------------+------------------------+---------------+--------------------+
| title | HEX(title) | LENGTH(title) | CHAR_LENGTH(title) |
+-------------+------------------------+---------------+--------------------+
| ÞÓã Çá | C39EC393C3A320C387C3A1 | 11 | 6 |
+-------------+------------------------+---------------+--------------------+

mysql> alter table forum modify title tinyblob;
Query OK, 19 rows affected (0.01 sec)
Records: 19 Duplicates: 0 Warnings: 0

mysql> SELECT `title`, HEX(title), LENGTH(title), CHAR_LENGTH(title) FROM forum where forumid=9;
+-------------+------------------------+---------------+--------------------+
| title | HEX(title) | LENGTH(title) | CHAR_LENGTH(title) |
+-------------+------------------------+---------------+--------------------+
| ÞÓã Çá | C39EC393C3A320C387C3A1 | 11 | 11 |
+-------------+------------------------+---------------+--------------------+

mysql> alter table forum modify title varchar(100) charset cp1256;
Query OK, 19 rows affected (0.01 sec)
Records: 19 Duplicates: 0 Warnings: 0

mysql> SELECT `title`, HEX(title), LENGTH(title), CHAR_LENGTH(title) FROM forum where forumid=9;
+--------------------------+------------------------+---------------+--------------------+
| title | HEX(title) | LENGTH(title) | CHAR_LENGTH(title) |
+--------------------------+------------------------+---------------+--------------------+
| أأ“أ£ أ‡أ، | C39EC393C3A320C387C3A1 | 11 | 11 |
+--------------------------+------------------------+---------------+--------------------+
1 row in set



If i try cp1256 and after utf8 or inverse will be a mess. Example

أأ“أ£ أ‡أ، | D8A3E2808DD8A3E2809CD8A3C2A320D8A3E280A1D8A3D88C | 24 | 11 |

tested with column using utf8_general_ci and utf8_unicode_ci (ORIGINAL)

Using root and users with regular privileges

Maybe i'm missing something. I don't have to mess with charsets very often.

Options: ReplyQuote


Subject
Views
Written By
Posted
4794
January 25, 2011 07:17PM
1647
January 27, 2011 02:57PM
1782
January 29, 2011 11:57PM
Re: Problem with arabic charset
2693
February 08, 2011 11:08PM
2468
February 10, 2011 10:05PM
1550
February 10, 2011 10:09PM
1554
February 10, 2011 10:41PM
2557
February 12, 2011 08:03PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.