Nkf #guess1 and #guess2 on html files

may be i’m not using correctly nkf #guess1 but it gaves me return type 3
(suuposed to be UTF-8) for ISO-8859-1 encoded files.

it gaves me also 3 for UTF-8 encoded files ???

my code is simply :

NKF.guess1(string)

with string=

also sometimes guess1 disaggreed with guess2 ???

whare could i find a table giving the encoding versus returned values
???

In Message-Id: [email protected]
[email protected] (Une be.AeNivue) writes:

may be i’m not using correctly nkf #guess1 but it gaves me return type 3
(suuposed to be UTF-8) for ISO-8859-1 encoded files.

it gaves me also 3 for UTF-8 encoded files ???

Unfortunately NKF is just for Japanese tool, so you can’t use it for
general code conversion / guessing, I think.

YANAGAWA Kazuhisa [email protected] wrote:

Unfortunately NKF is just for Japanese tool, so you can’t use it for
general code conversion / guessing, I think.

ok, fine, i need just a tool in order to discriminate between ISO-8859-1
and UTF-8 (as a first step) without using the meta content-type charset
in the html file, which isn’t reliable, for example a Ruby Cocoa site
(http://www.rubycocoa.com/the-rubification-of-rtw) says it’s
ISO-8859-1 encoding (in the meta tag) but it is in fact UTF-8 (said by
Firefox and text editor and also http headers…)

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