Unicode with MySQL4.1

2003-11-05 Thread srinivas reddy
Hi,
I have installed XFree86 4.3 and started xterm with
xterm -fn
-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1

Then started mysql with
mysql --default-character-set=utf8

Set LC_CTYPE to en_US.UTF-8 on my SuSE 8 machine.

Still I am not able to display Unicode characters.

I tried
select convert(_ucs2 0x0400 using utf8);
+--+
| convert(_ucs2 0x213e using utf8) |
+--+
| ?|
+--+
1 row in set (0.01 sec)

This is working though,
select convert(_ucs2 0x00D4 using utf8);
+--+
| convert(_ucs2 0x00D4 using utf8) |
+--+
| Ô|
+--+
1 row in set (0.01 sec)

I appreciate your help

Thanks,
Srinivas

=
Its what inside that makes the difference -- Lance Armstrong

__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Unicode with MySQL4.1

2003-11-04 Thread srinivas reddy
It seems to be working, but I am facing a glitch with
display.

I tried
select convert(_ucs2 0x0400 using utf8);
+--+
| convert(_ucs2 0x0400 using utf8) |
+--+
| ?|
+--+
1 row in set (0.00 sec)

Why is '?' displayed instead of the actual character?

Thanks,
Srinivas
--- Jeremy March [EMAIL PROTECTED] wrote:
 Remember that utf8 is not the same as the Unicode
 codepoints.  If you want 
 to enter utf8 like that you need to convert it from
 ucs2 first.  Try this:
 
 SELECT convert(_ucs2 0x00d4 using utf8);
 
 and to insert:
 
 INSERT INTO your_table values (convert(_ucs2 0x00d4
 using utf8));
 
 You can compare the character with its utf8
 hexidecimal:
 
 SELECT hex(my_column), my_column FROM your_table;
 
 Hope this helps,
 Jeremy March
 

_
 MSN Shopping upgraded for the holidays!  Snappier
 product search... 
 http://shopping.msn.com
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   

http://lists.mysql.com/[EMAIL PROTECTED]
 


=
I am not afraid of losing. But I don't like it.

__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Unicode with MySQL4.1

2003-11-04 Thread Jeremy March
You need to be sure you are using a Unicode font.  Are you using xterm?  If 
so you can go to the edit tab and click Current Profile to change the font.  
Also note that most Unicode fonts only cover subsets of Unicode not the 
whole thing so use a font that supports the language you are using.  I use 
the MiscFixed that comes with Red Hat and maybe other distributions too.

It works for me:

mysql select convert(_ucs2 0x00d4 using utf8);
+--+
| convert(_ucs2 0x00d4 using utf8) |
+--+
| Ô   |
+--+
1 row in set (0.00 sec)
Jeremy

_
Is your computer infected with a virus?  Find out with a FREE computer virus 
scan from McAfee.  Take the FreeScan now! 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Unicode with MySQL4.1

2003-11-04 Thread Jeremy March
Oops--the Unicode character must have gotten lost in the email, but it does 
show up in MySQL.  Its an O with a line above it.

_
MSN Messenger with backgrounds, emoticons and more. 
http://www.msnmessenger-download.com/tracking/cdp_customize

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Unicode with MySQL4.1

2003-11-03 Thread srinivas reddy
Hi,
I am trying to insert unicode characters in to a table
from mysql client, but I am unable to.

My configuration is
MySQL4.1.0-alpha on SunOS8. Installed MySQL from
source with support for all character sets.

Created table with create table mm(xyz varchar(10)
character set utf8), and started mysql client with
mysql --default-character-set=utf8. Then I tried to
insert unicode characters in to mm using hexadecimal
notation. But its not working. I read in the manual
that hexadecimal constants are parsed pair by pair. Is
that the case for Unicode character set also? If so,
how can I insert unicode characters in to tables from
command line.

I tried following command.
select 0x00D4;
++
| 0x00D4 |
++
||
++
1 row in set (0.00 sec).

My machine's default character set US-ASCII. Is that
creating problems with displaying unicode characters?
I would appreciate your help.

Thanks,
Srinivas


=
I am not afraid of losing. But I don't like it.

__
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Unicode with MySQL4.1

2003-11-03 Thread Jeremy March
Remember that utf8 is not the same as the Unicode codepoints.  If you want 
to enter utf8 like that you need to convert it from ucs2 first.  Try this:

SELECT convert(_ucs2 0x00d4 using utf8);

and to insert:

INSERT INTO your_table values (convert(_ucs2 0x00d4 using utf8));

You can compare the character with its utf8 hexidecimal:

SELECT hex(my_column), my_column FROM your_table;

Hope this helps,
Jeremy March
_
MSN Shopping upgraded for the holidays!  Snappier product search... 
http://shopping.msn.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]