Re: Creating UTF-8 characters from scratch
| From: | Yasuo Ohgaki | Date: | Thu, 19 Apr 2001 03:51:47 +0000 |
| Subject: | Re: Creating UTF-8 characters from scratch | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-49318@lists.php.net to get a copy of this message | ||
My mail client converted invalid char code for the original post to '?'.
Anyway, PHP works well with multi-byte chars and it works well with UTF-8/EUC at
least.
Not sure if PHP work well with KOI, though.
This works. $value = 'ABCDabcd日本語文字列12341234';
(This mail's char code must be UTF-8 if it's working ok, and you should be able
to view some kanji if you have font)
--
Yasuo Ohgaki
""Yasuo Ohgaki"" <yohgaki@hotmail.com> wrote in message
news:9blmbg$k8k$1@toye.p.sourceforge.net...
> I don't know about "Cyrillic", but anyway,
>
> Why not just assign UTF-8 char codes to variables?
> (It would be nice if there is hex2bin(), though. You can use sprintf() assign
> sort of binary value, but it would not work well to assign multi-byte char
> values since it interpret as integer)
>
> I think PHP is basically multi-byte char safe. (Code like BIG5 would not work,
> though)
>
> I use PostgreSQL with EUC-JP for backend and client.
> (PostgreSQL supports UTF-8 also and you don't have to do anything special for
> UTF-8 as well as various EUC/Mule codes. PostgreSQL users also can rely on
> automatic code conversion between backend and client. For example, I can use
EUC
> for client while backend is using UTF8.)
>
> It's possible to pass query like this to pg_exec()
> (You will see some garbage unless your mail client support JIS char code which
> is one of multi-byte char code)
>
> $text = 'PgSQL work well with ????????????';
> $query =<<<EOQ
> INSERT INTO employee (
> id,
> name,
> country,
> single_byte_char_and_multi_byte_char
> ) VALUES (
> 12345,
> '????',
> '??',
> '$text'
> );
> EOQ;
>
>
> I don't have enough experience with MySQL and multi-byte chars, but you should
> be able to do similar thing.
>
> All you need is database, editor and input method that supports multi-byte
> chars.
>
> Regards,
> --
> Yasuo Ohgaki
>
>
> "Dennis Gearon" <gearond@OIT.EDU> wrote in message
> news:3ADDF8C1.3E8B453F@oit.edu...
> > I want to try inserting a UTF-8 string into a varchar field. I'd like to
> > try something like cyrillic, which I know uses multiple byte characters
> > mixed with single byte characters. Anyone know how to create binary
> > values as an argument to insert into a field?
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>