Mailing List Archive

Support open source code!


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

Re: tlug: EUC & SJIS



On Sep 10,  9:33am, Scott Stone wrote:
} Subject: Re: tlug: EUC & SJIS
>> On Wed, 9 Sep 1998, Jim Breen wrote:
>> 
>> >  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. 
>> 
>> 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 :)

Hmmm. I've had a fair bit of experience in working out Japanese
encapsulation on the fly. I don't know the ins and outs of jcode.pl, but
since the POST variables I'm talking about typically had a two-kanji
jukugo in them, the overlap of the EUC and SJIS code spaces almost
guarantees a wrong guess a lot of the time. (Usually you have to scan
along looking for a sequence that violates one or the other method.)

As for sending back what the browser wants, stuff them! I put the
appropriate <meta ...> header on and send them EUC.  8-)}

BTW, in case anyone has tried WWWJDIC's "word translation" feature where
you give it either a slab of Japanese text or a URL and it sends back a
glossing of the jukugo/gairaigo, I pass it through "jconv" first to get it
into EUC. 

Jim

-- 
Jim Breen        School of Computer Science & Software Engineering
Email: j.breen@example.com                Monash University
http://www.csse.monash.edu.au/~jwb/     Clayton VIC 3168 Australia
P: +61 3 9905 3298 F: 9905 3574  $@%8%`!&%V%j!<%s(J@$@%b%J%7%eBg3X(J
--------------------------------------------------------------
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