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" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to