Forum: Ruby converting multi-byte strings on Windows?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
760e5c90000057a6860986b69b77c400?d=identicon&s=25 John Griffiths (indiehead)
on 2009-01-16 19:45
basically i'm reading in a csv file in Windows and it contains a lot of
multi-byte data (squigles, male-female signs etc.), now it's going to be
passed to mysql to insert into the database but because of these weird
characters it screws up the "fdsfdsf" in the queries and breaks the

Any ideas how to get this data into something like ascii or proper

i've tried these...

  data.gsub(/[‘]/, '\\\\\‘')
  Iconv.iconv("UTF-8", "UTF-8", data)

but no dice, i'm probably doing things wrong but would love to know a
proper way around this ?

stuck and in need of advice?
760e5c90000057a6860986b69b77c400?d=identicon&s=25 John Griffiths (indiehead)
on 2009-01-19 01:30
think i solved it,

    puts Iconv.iconv('US-ASCII//TRANSLIT', 'utf-8',s).to_s
This topic is locked and can not be replied to.