Hello.
This should be fixed in 5.0.18. See: http://bugs.mysql.com/bug.php?id=13909 Hirofumi Fujiwara wrote: > Dear MySQL fans, > > I want to make a function which returns utf8 string. > > > mysql> CREATE FUNCTION hello() RETURNS CHAR(20) CHARACTER SET utf8 > -> RETURN 'japanese-string'; > Query OK, 0 rows affected (0.02 sec) > > mysql> SELECT hello(); > +-----------------+ > | hello() | > +-----------------+ > | japanese-string | > +-----------------+ > 1 row in set (0.00 sec) > > mysql> > > but, returned character type is binary. > > mysql> SELECT CHARSET(hello()); > +------------------+ > | CHARSET(hello()) | > +------------------+ > | binary | > +------------------+ > 1 row in set (0.00 sec) > > mysql> > > I tried to make function tokyo() which returns string 'Tokyo' in Japanase. > _utf8 X'E69DB1E4BAAC' means Tokyo in Japanese. > > mysql> CREATE FUNCTION tokyo() RETURNS CHAR(20) CHARACTER SET utf8 > -> RETURN _utf8 X'E69DB1E4BAAC'; > Query OK, 0 rows affected (0.01 sec) > > mysql> SELECT tokyo(); > +---------+ > | tokyo() | > +---------+ > | ?? | > +---------+ > 1 row in set (0.03 sec) > > mysql> SELECT hex(tokyo()); > +--------------+ > | hex(tokyo()) | > +--------------+ > | 3F3F | > +--------------+ > 1 row in set (0.01 sec) > > mysql> SELECT CHARSET(tokyo()); > +------------------+ > | CHARSET(tokyo()) | > +------------------+ > | binary | > +------------------+ > 1 row in set (0.00 sec) > > > mysql> > > But function's returns character type is always binary. > > I want to know how to return utf8 string. > > ------------------------------------------------------------ > Hirofumi Fujiwara (Tokyo JAPAN) enjoy JAVA and Puzzle World > [EMAIL PROTECTED] http://www.pro.or.jp/~fuji/index-eng.html > [EMAIL PROTECTED] Puzzle Japan http://www.puzzle.jp/ > ------------------------------------------------------------ > -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.NET http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Gleb Paharenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]