Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: EUC & SJIS



On Wed, 9 Sep 1998, Jim Breen wrote:

> >> Microsoft Runs S-JIS to the best of my knowledge and I have no clue
> >> what Mac does.
> 
> I learnt the hard way that IE actually converts pages into SJIS. In
> WWWJDIC I embed the search key in the POST variables for functions like
> "continue_displaying_matches_of_this_key". Sure enough, they cam back
> from IE in SJIS, although I had sent out the HTML in EUC. Grrrr. The fix
> was to %-encode all the Japanese going out in such variables, to keep
> the sticky fingers off them, then (doubly) un-% them on return. Doubly,
> because %ab%cd came back as %25ab%25cd  8-)}.

If you have a Japanese version of perl and have 'jcode.pl', it's
relatively easy to:

1.  figure out what encoding the user's typed form input with
2.  convert it to what YOU want it to be
3.  convert it back to what their browser wants :)

I used this extensively a while back when converting from Microsoft SQL
Server to our current Linux-based Empress database.  As you can imagine,
SQL server encodes in SJIS (and frequently breaks double-byte data - I'd
strongly advise against SQL server in Japan for this reason), and
Empress.. well, Empress doesn't care, you can encode it in anything - but
we chose EUC, since it's easier to work with.  So I had to export all the
data from SQL server, convert it to EUC, and dump it into Empress.
According to Jperl, not all of the data in the SQL server database was
even properly recognizable as *any* encoding format, but most of it was
convertable without too much trouble.

--------------------------------------------------
Scott M. Stone <sstone@example.com, sstone@example.com>
               <sstone@example.com>
Head of TurboLinux Development/Systems Administrator
Pacific HiTech, Inc (USA) / Pacific HiTech, KK (Japan)
http://www.pht.com		http://armadillo.pht.co.jp
http://www.pht.co.jp	        http://www.turbolinux.com


--------------------------------------------------------------
Next Nomikai: 18 September, 19:30 Tengu TokyoEkiMae 03-3275-3691
Next Meeting: 10 October, Tokyo Station Yaesu central gate 12:30
--------------------------------------------------------------
Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links