perl-unicode

Re: DBD:mysql and UNICODE

2001-08-02 20:06:44
Hello perl unicoders,

I have only taken the digest of this list up to now, and not
posted anything, but I have some questions and comments
(and probably more questions to come).

At 22:05 01/08/02 +0200, Bjoern Hoehrmann wrote:
* Vuillemot, Ward W wrote:
>UNICODE is a character encoding

From the subject, and a previous mail, I infer it's possible
to store Unicode in mysql. I was actually thinking of doing
that, but the only thing I found out is:
- Mysql has Unicode support listed on the 'to do' list, but
  not close to the top.
- I could tweak mysql to be used for Unicode by telling it
  to use some 8-bit encoding, store UTF-8, and be careful
  to not use sql text functions such as LIKE.

If that summary is wrong, any help/pointers,... are very, very
welcome.

>[...] can I just avoid it and send the UNICODE data directly to a
>web-browser and let the browser do whatever is necessary.

Not possible, since the browser retrieves a stream of bytes and must
re-translate those bytes into characters in order to parse the data.

Correct, but easy to misunderstand. You don't have Unicode in the
database either, you already use some encoding there. If that
encoding happens to be UTF-8, you can construct and send an
UTF-8 web page to the browser. Older browsers may have problems,
but newer ones can handle it very well. Please don't forget
to declare that you are using utf-8 in the http header:

Content-Type: text/html;charset=utf-8

Regards,   Martin.

<Prev in Thread] Current Thread [Next in Thread>