Non English characters

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.

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 :expressionless:

Does anyone have a recipe?

Warm regards,

Bealach

Thanks for that, but I’ve not found a decent tutorial yet…still
looking :slight_smile:

Bealach

http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings
http://www.globalize-rails.org/wiki/

        - dan


Dan K. mailto:[email protected]
http://www.dankohn.com/ tel:+1-415-233-1000

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 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
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Bealach Na Bo wrote:

??? stored in the db and displayed in the browser.

Bealach

Hi,

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 B. (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.

Hi,

Still no luck :expressionless:

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 23-jul-2006, at 21:20, Bealach Na Bo wrote:

Hi,

Still no luck :expressionless:

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.

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.

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.

Still no luck :expressionless:

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs