From neongrau at gmail.com Mon Sep 3 05:02:15 2007 From: neongrau at gmail.com (neongrau __) Date: Mon, 3 Sep 2007 11:02:15 +0200 Subject: [Rails I18n] Legacy ISO-8859-1 MSSQL db and UTF8 rails app In-Reply-To: <64f457d2222fdd531635bc43aa63b37d@ruby-forum.com> References: <64f457d2222fdd531635bc43aa63b37d@ruby-forum.com> Message-ID: <7776d611a664493070e6451242e96c77@ruby-forum.com> i'm having a quite similar issue atm and i'm unsure what to do. same thing, Legacy MSSQL Database with windows-1252 charset (so iso compatible) on the legacy tables, and the Rails app purely using UTF-8. i had no problems with encodings while using the sqlserver driver in ado mode and setting: WIN32OLE.codepage = WIN32OLE::CP_UTF8 but unfortunately the ado driver is leaking memory so badly that the mongrels need to be restarted every 2 hours. when i switch to odbc mode, the memory leak is gone but with ODBC the codepage setting doesn't work anymore, so i get messed up texts from those old tables. so i have to choose between the 2 evils: 1. memory leaking app with proper encoding or 2. stable app with garbled text -- Posted via http://www.ruby-forum.com/. From hellolinus at gmail.com Mon Sep 3 05:33:24 2007 From: hellolinus at gmail.com (Tom Bak) Date: Mon, 3 Sep 2007 11:33:24 +0200 Subject: [Rails I18n] Legacy ISO-8859-1 MSSQL db and UTF8 rails app In-Reply-To: <7776d611a664493070e6451242e96c77@ruby-forum.com> References: <64f457d2222fdd531635bc43aa63b37d@ruby-forum.com> <7776d611a664493070e6451242e96c77@ruby-forum.com> Message-ID: <17818186ab7c9ff95567ad36e208b41c@ruby-forum.com> I solved my problem with own plugin: recode_legacy_database :from => "ISO-8859-1", :to => "UTF-8" Which translates fields in models on read and before write to database. Cheers, Tomasz Attachments: http://www.ruby-forum.com/attachment/216/recode_legacy_database.zip -- Posted via http://www.ruby-forum.com/. From neongrau at gmail.com Mon Sep 3 06:09:08 2007 From: neongrau at gmail.com (neongrau __) Date: Mon, 3 Sep 2007 12:09:08 +0200 Subject: [Rails I18n] Legacy ISO-8859-1 MSSQL db and UTF8 rails app In-Reply-To: <17818186ab7c9ff95567ad36e208b41c@ruby-forum.com> References: <64f457d2222fdd531635bc43aa63b37d@ruby-forum.com> <7776d611a664493070e6451242e96c77@ruby-forum.com> <17818186ab7c9ff95567ad36e208b41c@ruby-forum.com> Message-ID: <4ba7237f87c0924a2fe4845b1c2f7baf@ruby-forum.com> Tom Bak wrote: > I solved my problem with own plugin: > > recode_legacy_database :from => "ISO-8859-1", :to => "UTF-8" > > Which translates fields in models on read and before write to database. > > Cheers, > Tomasz so this is for a one time conversion of the whole db? i don't have the luxury to do that because the legacy tables still get accessed by the legacy app :( -- Posted via http://www.ruby-forum.com/. From hellolinus at gmail.com Mon Sep 3 06:15:40 2007 From: hellolinus at gmail.com (Tom Bak) Date: Mon, 3 Sep 2007 12:15:40 +0200 Subject: [Rails I18n] Legacy ISO-8859-1 MSSQL db and UTF8 rails app In-Reply-To: <4ba7237f87c0924a2fe4845b1c2f7baf@ruby-forum.com> References: <64f457d2222fdd531635bc43aa63b37d@ruby-forum.com> <7776d611a664493070e6451242e96c77@ruby-forum.com> <17818186ab7c9ff95567ad36e208b41c@ruby-forum.com> <4ba7237f87c0924a2fe4845b1c2f7baf@ruby-forum.com> Message-ID: <2c6bd6ba448ff932551fa28f112c2e4a@ruby-forum.com> neongrau __ wrote: > Tom Bak wrote: >> I solved my problem with own plugin: >> >> recode_legacy_database :from => "ISO-8859-1", :to => "UTF-8" >> >> Which translates fields in models on read and before write to database. >> >> Cheers, >> Tomasz > > so this is for a one time conversion of the whole db? Exacly the oposit. I probably should change naming. I recodes db "on fly". Check the code. Cheers, Tomasz Bak -- Posted via http://www.ruby-forum.com/. From rochkind at jhu.edu Wed Sep 5 15:46:14 2007 From: rochkind at jhu.edu (Jonathan Rochkind) Date: Wed, 5 Sep 2007 21:46:14 +0200 Subject: [Rails I18n] Unicode in URL param? Message-ID: <413463766df6d66de5221cd1c8b23756@ruby-forum.com> Can I put unicode chars in a URL param value? If so... how? Right now, in my URL params generated by Umlaut, Unicode seems to get corrupted. I have a string with unicode in it--when sent to the browser, it displays properly. But I put that string in a param value, and make a request, and look at the value, and send it to the browser---now it no longer displays correctly, the unicode char displays as two wrong chars. Any ideas what's going on, or how to deal with this? Thanks for any advice. -- Posted via http://www.ruby-forum.com/. From rochkind at jhu.edu Fri Sep 7 14:24:11 2007 From: rochkind at jhu.edu (Jonathan Rochkind) Date: Fri, 7 Sep 2007 20:24:11 +0200 Subject: [Rails I18n] Double-encoded UTF-8? In-Reply-To: <413463766df6d66de5221cd1c8b23756@ruby-forum.com> References: <413463766df6d66de5221cd1c8b23756@ruby-forum.com> Message-ID: <5f8a14605aa209025394a23ee8718f3c@ruby-forum.com> Actually, in response to my own previous question---I hadn't properly isolated the bug. Here's what's really going on. An external data source, not under my control, is giving me strings that are actually "double-encoded UTF-8" via an HTTP XML API. I can't do anything about this data, this is the way it comes. (Yes, the provider of this data is written in Perl. Grr.) Is there any easy way I can somehow return this double-encoded UTF-8 to real legitimate UTF-8 in Ruby? Any advice? Jonathan -- Posted via http://www.ruby-forum.com/. From moigg2000 at yahoo.fr Fri Sep 7 18:56:18 2007 From: moigg2000 at yahoo.fr (Guillaume Differenthink) Date: Sat, 8 Sep 2007 00:56:18 +0200 Subject: [Rails I18n] removing accents from sentences (ex: url creations) - wh In-Reply-To: <4a68b8cf0708230859o1c70f8ebj86c0e332bf49af0b@mail.gmail.com> References: <4a68b8cf0708230859o1c70f8ebj86c0e332bf49af0b@mail.gmail.com> Message-ID: Same question as you Guillaume. Thibaut Barr?re wrote: > Hi! > > I could not find it so far - but maybe rails i18n is the right list for > that > question: is there something already available somewhere in the ruby > space > to remove accents and other diacritics from a string ? (like: > translation > ?ph?m?re to ephemere, etc) > > I've seen the mephisto PermalinkFu trick (iconv from utf-8 to > ascii//ignore//translit) but it doesn't work on my workstation. > > I've attached DiacriticsFu which I wrote and is working fine for me - > I'd be > happy to find something cleaner, cross-platform, and which does not rely > on > Rails like this implementation (it would most likely work with unicode > hacks) > > any hint, comment, link, idea ? > > cheers > > Thibaut -- Posted via http://www.ruby-forum.com/. From freestyle_kayaker at hotmail.com Sun Sep 9 08:05:19 2007 From: freestyle_kayaker at hotmail.com (Tim Perrett) Date: Sun, 9 Sep 2007 14:05:19 +0200 Subject: [Rails I18n] Indentifier name too long In-Reply-To: References: <292e73400609042221w7783f035o56375dedffed4fa2@mail.gmail.com> Message-ID: <9ddfc0022b5a24e06eb818899b1b9bf1@ruby-forum.com> FYI - this is on line 71 of data.rake in the globalize directory Cheers Tim Martin Bernd Schmeil wrote: > Just add a > > :name => ???something_idx??? -- Posted via http://www.ruby-forum.com/.