in reply to UTF-8 entities in XML/HTML?

Hi, Jot -

I have to admit I am not familiar with most of the modules you mention so my advice below may be completely off the mark. I have, however, also worked with large UTF-8 encoded XML files before that contained German language entities, some of which were sensitive to character encoding (especially the umlauts).

The solution that worked best for me was to use the Linux command recode encoding_old..encoding_new file_name where encoding_old and encoding_new are the character encodings between which you want to re-encode your XML file file_name. I found it easiest to convert your whole XML file into the appropriate character encoding before processing it and then re-convert it once you are done. To find out which character sets your system has available for re-encoding use recode –l.

Again, I am not sure this really helps. Apologies if it doesn't.

Cheers -

Pat

Replies are listed 'Best First'.
Re^2: UTF-8 entities in XML/HTML?
by Anonymous Monk on Sep 03, 2008 at 16:01 UTC

    - it does help, thanks! Your answer is relevant for my data migration phase I haven't tackled yet. Momentarily I try to make the script working in a clean way. Phase two will be converting the old messages to UTF-8, where your hints will become handy.

    Since you have touched German entities before, I have heard there are three ways to encode them (at least in HTML), one is via named entity, like ä, another via one-byte numeric code situated between 128..255. And third is the two-bytes one I am trying to achieve (as I thought it's a more generic way to encode things). Any idea what should be the preference?

    Jot

      Hi, Jot -

      I was working with the SALSA corpus of syntactically and semantically annotated German newspaper sentences. The corpus follows the TIGER annotation standards.

      In the corpus, a UTF-8 encoded lowercase German a-umlaut ('ä'), e.g., would be rendered in ISO-8859-1 as ä. I am not sure, however, which encoding variant of those you mention this corresponds to.

      Hope this helps anyway.

      Pat