Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Iconv.iconv and Windows XP

Reply
Thread Tools

Iconv.iconv and Windows XP

 
 
Tim Ferrell
Guest
Posts: n/a
 
      10-02-2005
I am trying to use the ruby-mp3info library on Windows XP and all is well unless
the tags have some Unicode in them. I installed GNU libiconv 1.9.1 and the
iconv.so file using the instructions found here:

http://wiki.rubyonrails.com/rails/pages/iconv

I get an exception, though, when I try using it. Here is the relevant code and
the error:

require "iconv"

#strip byte-order bytes if they exists
data[0..3] =~ /^[\xff\xfe]+$/ and data = data[2..-1]

data = Iconv.iconv("ISO-8859-1", "UNICODE", data)[0]

--

#<Errno::ENOENT: No such file or directory - iconv("ISO-8859-1", "UNICODE")>

I am totally lost on this ... any ideas? Also is there any kind of alternative
to iconv on Windows?

Thanks,
Tim



 
Reply With Quote
 
 
 
 
Dave Burt
Guest
Posts: n/a
 
      10-03-2005
Tim Ferrell wrote:
> data = Iconv.iconv("ISO-8859-1", "UNICODE", data)[0]
>
> #<Errno::ENOENT: No such file or directory - iconv("ISO-8859-1",
> "UNICODE")>
>
> I am totally lost on this ... any ideas?


Your iconv install is working fine. Did you use my installer?

The library (which is written in C, so that's its excuse) throws the C error
ENOENT, which is a generic error meaning "file not found," when you feed it
an encoding name it doesn't know about. "Unicode" is one of those encoding
names.

I'm not sure exactly what you're after here, but (from
http://www.unicode.org/glossary) "There are seven character encoding schemes
in Unicode: UTF-8, UTF-16, UTF-16BE, UTF-16LE, UTF-32, UTF-32BE, and
UTF-32LE." There are also UCS-2 (and UCS-2BE and UCS-2LE, relatively common)
and UCS-4, which are all different encoding schemas.

You probably want "UTF-8". It's popular.

> Also is there any kind of alternative to iconv on Windows?


I'm not aware of anything better supported in Ruby. There is another lib
that I've forgotten the name of. So I would say, "no." No.

Cheers,
Dave


 
Reply With Quote
 
 
 
 
Tim
Guest
Posts: n/a
 
      10-03-2005
Thanks much for the reply ... I picked up the lib in question (mp3info)
from RAA and and am somewhat unfamiliar with the code but your point
makes perfect sense, now that you mention it

I'll change "UNICODE" to "UTF-8" and see where that gets me ... if it
works I'll contact the original author with a patch that also will
include some small fixes I've added along the way.

Thanks much!
Tim

Dave Burt wrote:
> Tim Ferrell wrote:
>
>> data = Iconv.iconv("ISO-8859-1", "UNICODE", data)[0]
>>
>>#<Errno::ENOENT: No such file or directory - iconv("ISO-8859-1",
>>"UNICODE")>
>>
>>I am totally lost on this ... any ideas?

>
>
> Your iconv install is working fine. Did you use my installer?
>
> The library (which is written in C, so that's its excuse) throws the C error
> ENOENT, which is a generic error meaning "file not found," when you feed it
> an encoding name it doesn't know about. "Unicode" is one of those encoding
> names.
>
> I'm not sure exactly what you're after here, but (from
> http://www.unicode.org/glossary) "There are seven character encoding schemes
> in Unicode: UTF-8, UTF-16, UTF-16BE, UTF-16LE, UTF-32, UTF-32BE, and
> UTF-32LE." There are also UCS-2 (and UCS-2BE and UCS-2LE, relatively common)
> and UCS-4, which are all different encoding schemas.
>
> You probably want "UTF-8". It's popular.
>
>
>>Also is there any kind of alternative to iconv on Windows?

>
>
> I'm not aware of anything better supported in Ruby. There is another lib
> that I've forgotten the name of. So I would say, "no." No.
>
> Cheers,
> Dave
>
>
>



 
Reply With Quote
 
Dave Burt
Guest
Posts: n/a
 
      10-04-2005
Tim wrote:
> I'll change "UNICODE" to "UTF-8" and see where that gets me ... if it
> works I'll contact the original author with a patch that also will include
> some small fixes I've added along the way.


An interesting thing I didn't put down in response to your original post is
that in past experience with command-line iconv, it dealt with aliases.
"Latin-1" is one I'm certain existed, and I believe "Unicode" was mapped to
"UTF-16" or something. I'm not sure where those aliases are, and why this
iconv/Ruby setup doesn't have them.

Cheers,
Dave


 
Reply With Quote
 
nobuyoshi nakada
Guest
Posts: n/a
 
      10-04-2005
Hi

At Tue, 4 Oct 2005 12:21:49 +0900,
Dave Burt wrote in [ruby-talk:158928]:
> An interesting thing I didn't put down in response to your original post is
> that in past experience with command-line iconv, it dealt with aliases.
> "Latin-1" is one I'm certain existed, and I believe "Unicode" was mapped to
> "UTF-16" or something. I'm not sure where those aliases are, and why this
> iconv/Ruby setup doesn't have them.


It needs config.charset[1] file, and does nothing for Windows.

[1]: http://www.ctan.org/tex-archive/macr...config.charset

--
Nobu Nakada


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Windows logon Screen in Windows 7 and Windows 2008 Tech Guy Windows 64bit 0 04-27-2011 12:59 PM
!Windows Live Mail replace Outlook Express on Windows XP and Windows Mail on Vista... Max Burke NZ Computing 8 05-18-2007 12:10 AM
Windows xp and windows 64bit and games. =?Utf-8?B?QXRvbA==?= Windows 64bit 10 12-05-2005 08:28 PM
wireless ad-hoc with Windows XP and Windows 2000 =?Utf-8?B?ZHVtbWthdWY=?= Wireless Networking 1 09-23-2004 11:34 AM
Windows XP laptop and Windows 2000 desktop won't communicate =?Utf-8?B?UmlmbGVtYW4=?= Wireless Networking 0 08-19-2004 03:35 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57