On Thu, Aug 31, 2006 at 08:52:41AM +0200, Michel Albert wrote:
> Unicode seems like a cure-all solution for dealing with special
> characters.
It is, mostly. But be aware that it has its own drawbacks.
> What is the best way to
> find out the encoding of a string.
There is no. You really have to know the encoding in advance. Either
store the encoding in metadata or standardize on one fixed encoding; in the
latter case it is recommended to use UTF-8.
> Let's say you write a web application. Basically the string has to
> pass through the following layers:
>
> Database -> Scripting language (python) -> web-server -> browser
Exactly opposite.
Browser -> (request) -> web-server -> web-app server -> DB backend >-\
|
(response) <- <- <- /
Browser sends the desired encoding in an every request in the Accept*
header(s). So web-server (like Russian Apache, a special patched version of
Apache) or web-app server can recode the request to the standard internal
encoding, store data in the backend, draw data from the backend in the
standard internal encoding, process the data, recode the result to the
browser encoding (get the encoding from the request) and return it to the
browser.
Note that you know the encoding before the process - browser explicitly
name it; and you use one standard internal encoding for the process and
storage. If the browser didn't pass any Accept* header - use default; try
latin-1, then UTF-8.
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss