R
Raymond O'Connor
Hi,
I have the following piece of code:
ic = Iconv.new('US-ASCII//TRANSLIT', 'UTF-8')
puts ic.iconv("Aüthor")
1. on my local machine (OSX 10.5) when I run this, I get the output:
A"uthor
2. when I run this same code on my debian server (via rake executed
through a capistrano task) I get the output: A?thor
3. when I run this same code on my debian server (via irb), I get:
Author
Both 1 and 3 are acceptable output to me, however I cant figure out how
to get my program to output the correct result on my server when I run
it through a capistrano task. Is there some environment variable I need
to set? From reading other posts, I've tried adding at the top of my
file:
$KCODE = "u"
require 'jcode'
ENV['LANG'] = 'en_US.UTF-8'
ENV['LC_CTYPE'] = 'en_US.UTF-8'
still doesn't fix the issue. Any help would be greatly appreciated.
Thanks,
Ray
I have the following piece of code:
ic = Iconv.new('US-ASCII//TRANSLIT', 'UTF-8')
puts ic.iconv("Aüthor")
1. on my local machine (OSX 10.5) when I run this, I get the output:
A"uthor
2. when I run this same code on my debian server (via rake executed
through a capistrano task) I get the output: A?thor
3. when I run this same code on my debian server (via irb), I get:
Author
Both 1 and 3 are acceptable output to me, however I cant figure out how
to get my program to output the correct result on my server when I run
it through a capistrano task. Is there some environment variable I need
to set? From reading other posts, I've tried adding at the top of my
file:
$KCODE = "u"
require 'jcode'
ENV['LANG'] = 'en_US.UTF-8'
ENV['LC_CTYPE'] = 'en_US.UTF-8'
still doesn't fix the issue. Any help would be greatly appreciated.
Thanks,
Ray