Problem with Iconv

I have a weird problem with Iconv... I'm trying to use it to generate a
permalink (so it removes all accentuated characters like french accents
etc..)..

It was working well when I was running RoR on cygwin... Now with Instant
Rails I get the following error:

Iconv::IllegalSequence in ItemController#new

The exact same method was working flawlessly on cygwin... now it chokes
at the first accentuated character...

Anyone has an idea ? (Please don't tell me to go back to cygwin, it was
really slow LOL)

thanks :slight_smile:

···

--
Posted via http://www.ruby-forum.com/.

Is this error happening with the same strings used as arguments?.
Maybe under cygwin you are using certain encoding and now the strings
you are using are in a different encoding.

···

On 9/25/07, Jean-nicolas Jolivet <phpcode@gmail.com> wrote:

It was working well when I was running RoR on cygwin... Now with Instant
Rails I get the following error:

Iconv::IllegalSequence in ItemController#new

The exact same method was working flawlessly on cygwin... now it chokes
at the first accentuated character...

Anyone has an idea ? (Please don't tell me to go back to cygwin, it was
really slow LOL)

--
Luis Parravicini
http://ktulu.com.ar/blog/

Luis Parravicini wrote:

Is this error happening with the same strings used as arguments?.
Maybe under cygwin you are using certain encoding and now the strings
you are using are in a different encoding.

Yes, it is the exact same string I'm using as argument!

Any way I could find out about the encoding?

Basically I'm trying to produce a permalink for an article name
(submitted via a webform)... and add it to the db..it works with strings
that don't have any special characters....but as soon as I add a French
or Spanish accent in my string... I get the error...

And I'm 100% sure the same code (I copy/pasted it) was working under
cygwin...

···

On 9/25/07, Jean-nicolas Jolivet <phpcode@gmail.com> wrote:

--
Posted via http://www.ruby-forum.com/\.

One "small" update...

if I use

Iconv.new('ascii//ignore//translit', 'utf-8').iconv

(i.e. adding ignore)... it will work, but the accentuated characters are
only removed... (and not converted to their utf-8 equivalent)...

using the following will also work:

Iconv.new('ISO-8859-1', 'utf-8').iconv

But I get weird results (some characters are removed, some are
converted..)

What I'm really wondering is, why 'ascii/translit' was working just
fine on cygwin and gives me an error on InstantRails ... :frowning:

···

--
Posted via http://www.ruby-forum.com/.