Mailing List Archive


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

Re: [tlug] Japanese encoding



[Brett Robson ([tlug] Japanese encoding) writes:]
>> Is there any automatic translation between encoding in the standard web
>> browser/web server model?
>> 
>> For instance, if you have a web form that accepts data, will the computer
>> that the user is using will send data in whatever encoding that computer
>> uses? Or the server? (I wouldn't think so) So is it true that my cgi script
>> running on Linux Apache could receive data any practically any format?

The client should/must submit the data from the form in the encoding of
the page. So if a page has been set to EUC-JP, via either the MIME
header right at the very front or via a <meta http-equiv charset="..">
the browser should submit it that way.

Note that this is coming from forms. There are other ways data can
arrive in a CGI program, e.g. from a Javascript toolbar button, a
hand-entered URL+parameters, etc. For example in the toolbar buttons
I generate for WWWJDIC, text can be cut from a WWW page and sent in from
Javascript. The coding works like this:

	Netscape 4 under Linux/Unix	->	EUC
	Netscape 4 under Windows	->	Shift_JIS
	IE5/6				->	UTF8
	Mozilla/Galeon/etc.		->	Whatever code the
						original page used.

These are but challenges we have to overcome. In both WWWJDIC and Google
there is a coding tag in the parameters so the CGI can react
appropriately. Goo autodetects in a very clever way.

In general though, if the page has the coding set to something, the data
should arrive in that coding.

HTH

Jim

-- 
Jim Breen  (j.breen@example.com  http://www.csse.monash.edu.au/~jwb/)
Computer Science & Software Engineering,                Tel: +61 3 9905 3298
P.O Box 26, Monash University,                          Fax: +61 3 9905 5146
Clayton VIC 3800, Australia      ジム・ブリーン@モナシュ大学

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links