[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

nkf #guess1 and #guess2 on html files

pere.noel

3/23/2006 8:07:00 AM

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=<whole file content>

also sometimes guess1 disaggreed with guess2 ???

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

--
une bévue
2 Answers

YANAGAWA Kazuhisa

3/23/2006 11:16:00 AM

0

In Message-Id: <1hcnady.1rrszh87n73rfN%pere.noel@laponie.com.invalid>
pere.noel@laponie.com.invalid (Une b.ANivue) 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.


--
kjana@dm4lab.to March 23, 2006
Out of sight, out of mind.



pere.noel

3/23/2006 11:52:00 AM

0

YANAGAWA Kazuhisa <kjana@dm4lab.to> 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-...) 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...)
--
une bévue