Japanese text, cgi, sql (again)

Nicolas Cueto niconiko at gmail.com
Thu Jun 4 02:35:31 EDT 2009


Hello All,

On and off over the last three years, I've
been trying to crack the problem of
downloading Japanese text which is
contained in a mysql database by
a stack + rev.cgi combination.

It's that time of year again.

As with past attempts, my latest too
works fine except for the same old
problem --  Japanese text arrives
in the stack garbled (English text
is ok).

Having tried a variety of suggestions
from this list and from Japanese-users
of Rev (the database's and its fields'
collations; Rev uniencode/unidecode/
unicodetext commands; etc),   my
latest thought is the problem may lie
with this final part of my cgi script:


  -- put "Content-Type: text/plain" & cr before buffer
  -- put "Content-Type: text/html; charset = utf-8" & cr
  put  "Content-Length:" && the length of buffer & cr & cr
  put buffer


As the commented-out lines show, I've tried
different "Content-Type".  But not having a full
understanding of how this or char-set work,
they're just blind guesses.

Could the cgi-script's content-type / charset
(or something else similar) be what's garbling
the Japanese text?

Perhaps this year will be the lucky one.

Thanks.

--
Nicolas Cueto



More information about the use-livecode mailing list