Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Has anyone experience using tag Soup to read Windows files on a Linux system?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: David Collier-Brown <davec-b AT rogers.com>
  • To: Peter Taylor <peter.taylor AT greenhat.com>
  • Cc: XOM API for Processing XML with Java <xom-interest AT lists.ibiblio.org>, davecb AT spamcop.net
  • Subject: Re: [XOM-interest] Has anyone experience using tag Soup to read Windows files on a Linux system?
  • Date: Sun, 06 Feb 2011 11:06:26 -0500

Thanks for the pointer, that solved the problem.

Nothing solves the underlying one, though. which is that I'm reading
Microsoft-produced dreck with Tag Soup, and the encoding is buried
several tags deep in a <meta http-equiv="Content-Type"
content="text/html; charset=windows-1252"/> tag. This breaks most sane
recognition schemes, so I have to specify it in the code (;-))

The solution for the real problem is to switch the company to using
InDesign or the like, and UTF-8.

--dave


Peter Taylor wrote:
> the xml declaration should have defined the encoding, but as a work-around
> try using this:
>
> http://download.oracle.com/javase/6/docs/api/java/io/InputStreamReader.html#InputStreamReader%28java.io.InputStream,%20java.lang.String%29
>
> to adapter the inputstream with a charset into a reader, then pass this
> reader to the InputSource.
>
>
> -----Original Message-----
> From: xom-interest-bounces AT lists.ibiblio.org on behalf of David
> Collier-Brown
> Sent: Sun 06/02/2011 01:08
> To: XOM API for Processing XML with Java
> Cc: davecb AT spamcop.net
> Subject: [SPAM(hdr)] - [XOM-interest] Has anyone experience using tag Soup
> to read Windows files on a Linux system?
>
> This is perhaps as much a tag soup question as an XOM one, but I'm
> trying to read a file created in a Windows character set and then copied
> to our production Linux system.
>
> Has anyone experience in explicitly setting the input character set so
> that the sax parser, in this case tag soup, can interpret it properly?
> I've experimented with setting the encoding with an InputSource, but
> with no visible effect.
>
> --dave
>
>


--
David Collier-Brown, | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
davecb AT spamcop.net | -- Mark Twain
(416) 223-8968





Archive powered by MHonArc 2.6.24.

Top of Page