convert utf-8 data MySQL to ucs-2 data and vice versa

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
zelot1980_vn
Forum Newbie
Posts: 2
Joined: Thu Jul 03, 2003 3:07 am
Location: programmer
Contact:

convert utf-8 data MySQL to ucs-2 data and vice versa

Post by zelot1980_vn »

Hi, All

I design a website using Utf-8. I use PHP and Mysql. Version Mysql 4.0.12-max-debug for Win95/Win98 on i32. But I want to convert Mysql data to Sql server 2000. I want to store utf-8 data in sql server. Unfortunately SQL server2000 and access use i different Unicode encoding (UCS-2) and do not recognize UTF-8 as valid character data.

I tried mb_convert_string of PHP
mb_convert_encoding($str, "UCS-2", "UTF-8");

However, result of this function is not good.

How do i convert utf-8 to ucs-2 and vice versa? Can I help you an algorithm convert utf-8 to ucs-2 and vice versa?

Sorry, my English is not well.

Thanks for all your help
Post Reply