Hi folks, Does anyone know how to tackle Swedish letters in Rails. Am I completely off track in thinking that it should be done using map or regex in some clever way? Bealach
I might have failed to understand, but Swedish letters are covered by utf-8, right? If so, just read a decent tutorial about handling utf-8 in Ruby. On 7/22/06, Bealach Na Bo <bealach@gmail.com> wrote:> Hi folks, > > Does anyone know how to tackle Swedish letters in Rails. Am I > completely off track in thinking that it should be done using map or > regex in some clever way? > > Bealach > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -Alder
Hi again, I just noticed that there is a "Swedish" thread, but I can''t figure out how to CRUD Swedish letters. The Swedish site that is quoted in that thread is in Swedish - not my forte :| Does anyone have a recipe? Warm regards, Bealach On 7/22/06, Bealach Na Bo <bealach@gmail.com> wrote:> Hi folks, > > Does anyone know how to tackle Swedish letters in Rails. Am I > completely off track in thinking that it should be done using map or > regex in some clever way? > > Bealach >
Thanks for that, but I''ve not found a decent tutorial yet....still looking :) Bealach On 7/22/06, Alder Green <alder.green@gmail.com> wrote:> I might have failed to understand, but Swedish letters are covered by > utf-8, right? If so, just read a decent tutorial about handling utf-8 > in Ruby. > > On 7/22/06, Bealach Na Bo <bealach@gmail.com> wrote: > > Hi folks, > > > > Does anyone know how to tackle Swedish letters in Rails. Am I > > completely off track in thinking that it should be done using map or > > regex in some clever way? > > > > Bealach > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > -Alder > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings http://www.globalize-rails.org/wiki/ - dan -- Dan Kohn <mailto:dan@dankohn.com> <http://www.dankohn.com/> <tel:+1-415-233-1000> On Jul 22, 2006, at 10:16 AM, Bealach Na Bo wrote:> Thanks for that, but I''ve not found a decent tutorial yet....still > looking :) > > Bealach > > On 7/22/06, Alder Green <alder.green@gmail.com> wrote: >> I might have failed to understand, but Swedish letters are covered by >> utf-8, right? If so, just read a decent tutorial about handling >> utf-8 >> in Ruby. >> >> On 7/22/06, Bealach Na Bo <bealach@gmail.com> wrote: >> > Hi folks, >> > >> > Does anyone know how to tackle Swedish letters in Rails. Am I >> > completely off track in thinking that it should be done using >> map or >> > regex in some clever way? >> > >> > Bealach >> > _______________________________________________ >> > Rails mailing list >> > Rails@lists.rubyonrails.org >> > http://lists.rubyonrails.org/mailman/listinfo/rails >> > >> >> >> -- >> -Alder >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Thanks for the pointers. I followed the instructions in the second of the two links, but am still unable to achieve what I''m after: I''m probably being very think here (forgive me :), but all I''m after is 1. present the user with a fill in form 2. store the data in an Oracle 10g database 3. retrieve and display the data The data in (1.) can contain all those funny Scandinavian letters like ? ? ? When I do this (after completing the steps in "globalize-rails") I get ??? stored in the db and displayed in the browser. Bealach On 7/22/06, Dan Kohn <dan@dankohn.com> wrote:> http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings > http://www.globalize-rails.org/wiki/ > > - dan > -- > Dan Kohn <mailto:dan@dankohn.com> > <http://www.dankohn.com/> <tel:+1-415-233-1000> > > > > On Jul 22, 2006, at 10:16 AM, Bealach Na Bo wrote: > > > Thanks for that, but I''ve not found a decent tutorial yet....still > > looking :) > > > > Bealach > > > > On 7/22/06, Alder Green <alder.green@gmail.com> wrote: > >> I might have failed to understand, but Swedish letters are covered by > >> utf-8, right? If so, just read a decent tutorial about handling > >> utf-8 > >> in Ruby. > >> > >> On 7/22/06, Bealach Na Bo <bealach@gmail.com> wrote: > >> > Hi folks, > >> > > >> > Does anyone know how to tackle Swedish letters in Rails. Am I > >> > completely off track in thinking that it should be done using > >> map or > >> > regex in some clever way? > >> > > >> > Bealach > >> > _______________________________________________ > >> > Rails mailing list > >> > Rails@lists.rubyonrails.org > >> > http://lists.rubyonrails.org/mailman/listinfo/rails > >> > > >> > >> > >> -- > >> -Alder > >> _______________________________________________ > >> Rails mailing list > >> Rails@lists.rubyonrails.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails > >> > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Bealach Na Bo wrote:> Thanks for the pointers. I followed the instructions in the second of > the two links, but am still unable to achieve what I''m after: > > I''m probably being very think here (forgive me :), but all I''m after is > 1. present the user with a fill in form > 2. store the data in an Oracle 10g database > 3. retrieve and display the data > > The data in (1.) can contain all those funny Scandinavian letters like ? > ? ? > When I do this (after completing the steps in "globalize-rails") I get > ??? stored in the db and displayed in the browser. > > BealachHi, Since I''m working in a Swedish environment, I''ve had this problem. But I''ve had quite much success with two simple solutions: Either add $KCODE="utf8" at the top of environment.rb, or setting the Oracle DB parameters (inside EM, probably. I don''t remember exactly which parameters, though...) But try the KCODE-approach. -- Ola Bini (http://ola-bini.blogspot.com) JvYAML, RbYAML, JRuby and Jatha contributor System Developer, Karolinska Institutet (http://www.ki.se) OLogix Consulting (http://www.ologix.com) "Yields falsehood when quined" yields falsehood when quined.
On 23-jul-2006, at 12:49, Bealach Na Bo wrote:> I''m probably being very think here (forgive me :), but all I''m > after is > 1. present the user with a fill in form > 2. store the data in an Oracle 10g database > 3. retrieve and display the data > > The data in (1.) can contain all those funny Scandinavian letters > like ? ? ? > When I do this (after completing the steps in "globalize-rails") I get > ??? stored in the db and displayed in the browser.First, install our unicode_hacks plugin. Second, look on the lazyweb for configuring Oracle to do what you need (charset and locale switches).
Hi, Still no luck :| Looks like unicode_hacks requires ICU v3.4 which, if I''m looking at the right site (http://www-306.ibm.com/software/globalization/icu/index.jsp) requires java. I don''t have java for my 64bit Debian machine. I do have a suspicion that I''ve misunderstood something here since I can''t imagine java classes to be the standard way of distributing unicode "libraries"..... I couldn''t make head or tail of the stuff on "lazyweb" - I found nothing relevant there. As far as Oracle configuration goes, I''m pretty sure that I''ve got it setup properly, since I can use isqlplus to enter, retrieve and display properly, things like ? ? ?. Bealach On 7/23/06, Julian ''Julik'' Tarkhanov <listbox@julik.nl> wrote:> > On 23-jul-2006, at 12:49, Bealach Na Bo wrote: > > > I''m probably being very think here (forgive me :), but all I''m > > after is > > 1. present the user with a fill in form > > 2. store the data in an Oracle 10g database > > 3. retrieve and display the data > > > > The data in (1.) can contain all those funny Scandinavian letters > > like ? ? ? > > When I do this (after completing the steps in "globalize-rails") I get > > ??? stored in the db and displayed in the browser. > > First, install our unicode_hacks plugin. Second, look on the lazyweb > for configuring Oracle to do what you need (charset and locale > switches)._______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
> Still no luck :| > > Looks like unicode_hacks requires ICU v3.4 which, if I''m looking at > the right site (http://www-306.ibm.com/software/globalization/icu/index.jsp) > requires java.<...> You need unicode_hack only if you want to do something more with your strings, not only store/retrieve them.> As far as Oracle configuration goes, I''m pretty sure that I''ve got it > setup properly, since I can use isqlplus to enter, retrieve and > display properly, things like ? ? ?.Is is possible that Oracle is configured and uses different encoding, say ISO8859-1, not utf. Regards, Rimantas -- http://rimantas.com/
On 23-jul-2006, at 21:20, Bealach Na Bo wrote:> Hi, > > Still no luck :| > > Looks like unicode_hacks requires ICU v3.4 which, if I''m looking at > the right site (http://www-306.ibm.com/software/globalization/icu/ > index.jsp) > requires java.And of which both are not true. unicode_hacks does not _require_ anything per s.e. it work sin pure Ruby now just as well. Without installing anything. It wil only work faster if you do have ICU4R.> > I couldn''t make head or tail of the stuff on "lazyweb" - I found > nothing relevant there.<quote from="http://www.adp-gmbh.ch/ora/misc/globalization.html"> Client character set The client character set is set with the environment variable NLS_LANG (on windows, it''s set in the registry and can be overridden by the environment variable NLS_LANG). Whenever a client opens a connection to Oracle, an NLS environment will be created for the client which determines how locale dependent things are displayed or formatted. </unquote> http://www.experts-exchange.com/Databases/Oracle/Q_21292465.html http://www.cs.umbc.edu/help/oracle8/server.815/a67789/ch1.htm Does your app have an NLS_LANG env variable? I just never ever used Oracle but every DB needs some stuff to be done to pass things properly.> > As far as Oracle configuration goes, I''m pretty sure that I''ve got it > setup properly, since I can use isqlplus to enter, retrieve and > display properly, things like ? ? ?.