[PHP] 0x9f54 is an invalid Big5 character! (was Re: [PHP] Re: 0x9f54)

2007-04-12 Thread Seak, Teng-Fong
OK, I took your problem from the other end. I tried to see what you're trying to store. I entered your 0x9F54 in a text file (using binary editor) and opened it in Firefox. Guess what! When the encoding is set to Big5, I just got a "?". But if I switch to Big5-HKSCS, I've got the "麁" c

Re: [PHP] Re: 0x9f54

2007-04-11 Thread Richard Lynch
On Wed, April 11, 2007 6:47 am, Man-wai Chang wrote: > how do you do string comparison in utf-8? say the user entered a > chinese > string the browser and you need to search for the string in the MySQL > table using PHP. *IF* the page that got the initial data was UTF-8 in its HTTP Headers and in

Re: [PHP] Re: 0x9f54

2007-04-11 Thread Seak, Teng-Fong
Man-wai Chang wrote: > how do you do string comparison in utf-8? say the user entered a chinese > string the browser and you need to search for the string in the MySQL > table using PHP. > How? Of course in the usual PHP way! (Be warned that we're getting more and more off-topic. This is

Re: [PHP] Re: 0x9f54

2007-04-11 Thread Seak, Teng-Fong
OK, I've spent five minutes to try to understand what you're doing. There're something I don't understand: 1. You use dbase_open("/home/bt/canton.DBF",0); which seems that you open a database file directly. Well, I don't do like this. I use mysql_connect("localhost", "username", "some_passwor

[PHP] Re: 0x9f54

2007-04-11 Thread Man-wai Chang
how do you do string comparison in utf-8? say the user entered a chinese string the browser and you need to search for the string in the MySQL table using PHP. -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you!

Re: [PHP] Re: 0x9f54

2007-04-10 Thread Seak, Teng-Fong
Seak, Teng-Fong wrote: > Anyway, you should look at the positive side of using Unicode > instead of the dinosaur encoding, sorry, I mean Big5 :p Hard drives > (and RAM) nowadays are getting real big, string size should be > I wanted to mean: string size should NOT be considered . :p

Re: [PHP] Re: 0x9f54

2007-04-10 Thread Seak, Teng-Fong
Man-wai Chang wrote: >> On the other hand, I remember you talked about the type of that >> column to be char(2). Have you specified what encoding it's using? >> Moreover, I hope you're not using legacy encoding like Big5 or GB. Use >> Unicode (UTF-8) if your database is a brand new one. >>

[PHP] Re: 0x9f54

2007-04-10 Thread Man-wai Chang
screenshot of the error: -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Ubuntu 6.10) Linux 2.6.20.6 ^ ^ 19:25:01 up 3 days 2:16 1 user load average: 1.03 1.08 1.08 news://news.3home.net news:/

[PHP] Re: 0x9f54

2007-04-10 Thread Man-wai Chang
> Well, show us a part of your code. Do var_dump($value) before you > enter it into the database, and see if it still says 0x9f54. The error: string(2) "" Duplicate entry '' for key 1 -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Fo

[PHP] Re: 0x9f54

2007-04-10 Thread Man-wai Chang
> On the other hand, I remember you talked about the type of that > column to be char(2). Have you specified what encoding it's using? > Moreover, I hope you're not using legacy encoding like Big5 or GB. Use > Unicode (UTF-8) if your database is a brand new one. Unfortunately, I am still usi

Re: [PHP] Re: 0x9f54

2007-04-02 Thread Seak, Teng-Fong
Man-wai Chang wrote: >>> MySQL? MSSQL? PgSQL? >>> Tijnema >>> >> It seems he wanted to insert a Chinese character with that hex value. >> > > Yes... I tried the insert with PHP, including the use of > mysql_real_escape_string(), but MySQL still gave me a blank only. Well, this

Re: [PHP] Re: 0x9f54

2007-04-01 Thread Tijnema !
On 4/1/07, Man-wai Chang <[EMAIL PROTECTED]> wrote: >> MySQL? MSSQL? PgSQL? >> Tijnema > It seems he wanted to insert a Chinese character with that hex value. Yes... I tried the insert with PHP, including the use of mysql_real_escape_string(), but MySQL still gave me a blank only. Well, sh

[PHP] Re: 0x9f54

2007-03-31 Thread Man-wai Chang
>> MySQL? MSSQL? PgSQL? >> Tijnema > It seems he wanted to insert a Chinese character with that hex value. Yes... I tried the insert with PHP, including the use of mysql_real_escape_string(), but MySQL still gave me a blank only. -- .~. Might, Courage, Vision, SINCERITY. http://www.linux