Michel Albert <[EMAIL PROTECTED]> writes: > 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 > > If you end up with unintelligible strings, what approach would you > suggest to examine it.
For a web application you should set the encoding in your (X)HTML file. The browser should respect that and give you back string in the same encoding. You can also check what encodings the browser said it supported. > The main problem lies in actually *viewing* the string in question. > Example: If you see garbled characters in - let's say - phpMyAdmin. > Then the error could be on any of the mentioned levels (except by > replacing python with php of course). It could even mean that the > character is simply saved wrong. So the display is correct, but the > data in the database is messed up. If you're working with Unicode do everything in Unicode. Including setting the correct metadata in the HTML page. > On the other hand, vieving the string in your console (on linux) it > might even get messed up with because of that. Again, the client should tell what encodings it support and whenever possible the string should be converted to that encoding. Preferably the client would also work with Unicode. (This is becoming common in Linux where major distributions set the language to <something>.UTF8 at install time.) > As appetiser, the way I usually end up examining a string, is looking > at it's hex representation and then looking up encoding > specifications/charts to see if the hex-code matches the > specification. If it does, I found the encoding. But that's a tedious > process. You can guess it wrong. (Example from memory, I might be wrong here but it is a valid example) Take ISO-8859-1 and ISO-8859-15, for example: in ISO-8859-1 there's the international money symbol in one position where in ISO-8859-15 there's the Euro symbol. So, in your "guess", what would be the correct encoding to choose? Be seeing you, -- Jorge Godoy <[EMAIL PROTECTED]> ------------------------------------------------------------------------- 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
