Re: Pb saving strings with accentuated characters (MySQL 5)
Jean Pierre Malrieu <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
Thanks for the reply. And pardon my ignorance. I have done some research in my database, and I discovered that as far as character encoding is concerned, it is a mess. The default server encoding is latin1. My database is default-encoded with latin1. But my tables are InnoDB, and seems to use utf-8. (ENGINE=InnoDB DEFAULT CHARSET=utf8) And finally, the columns for my text and varchar columns use collation utf8_general_ci, which seems to imply that their character set is utf8. So, I suppose I should do some cleaning up and either restore latin1 encoding or move to utf8. As you suggest me to move to utf8 (and my textual data already seems to be utf8 encoded), what would it involve? Let me try to guess. 1/ specify utf8 as the charset for all my pages (what tool is the most appropriate to do so? I suppose I need to CONVERT the html to utf8 in order to get static strings right. Is there a tool that can automate the process? Can WOBuilder be used for that purpose?) 2/ modify the connection dictionnary (something like useUnicode= true and characterEncoding=utf8) 3/ something else? But what do you mean by "both in the <head> section and in the web server". Do I have to tell apache to use utf8? JPM Le 24 mai 06 à 16:48, Dev WO a écrit : > Hello Jean Pierre, > just a quick suggestion: you should move to UTF-8;) > despite that, you should check the following: > -an HTML form send the text back to the server using the same > encoding of the web page so you've got to make sure your HTML > declares ISO-8859-1 (both in the <head> section and in the web server) > -you've got to check the encoding of your SQL database to make sur > it also uses ISO-8859-1 > -you've got a wrong connection dictionary, you are saying to use > unicode but specify a non-unicode encoding...removing it doesn't > change anything as java default to unicode (UTF-8) > so your connection dictionary might be > useUnicode=false&characterEncoding=ISO-8859-1 > -finally just make sur the woresponse get the right header > concerning the encoding (ISO-8859-1 in your case) > > Hope this help, I think the connection dictionary is in fault, but > checking the other part is worth it;) > > Xavier > > >> Hi, >> >> I am having a problem with saving a String to a MySQL 5 database. >> If I type the text within a WOText and save it, no problem. >> But if I paste the text from MS Word, let's say, and save it, then >> the string is trimmed after the first accentuated character. The >> only characters that get saved are the characters before the first >> accentuated character. >> >> This happens with different browsers and generated SQL looks fine. >> >> I used to pass parameters >> (useUnicode=true&characterEncoding=ISO-8859-1) to the jdbc >> connector (version 3.1.12). I have tried removing those >> parameters, thinking they might be irrelevant for MySQL 5. But the >> problem remains. >> >> Do you guys have any ideas of what could be going on? >> >> Thanks. >> >> JPM >> >> >> >> _______________________________________________ >> WebObjects-dev mailing list >> [email protected] >> http://www.omnigroup.com/mailman/listinfo/webobjects-dev >> > >