diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2013-03-15 19:02:14 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-03-15 16:29:37 -0700 |
commit | 757791335f212a189790452cb2d467c31a2ae672 (patch) | |
tree | 1a30448a7f69efd479c711f1999333f2502ee767 /xslt/divelogs.xslt | |
parent | 98d769a02fc4f42c5afb20153847ab358ecc126f (diff) | |
download | subsurface-757791335f212a189790452cb2d467c31a2ae672.tar.gz |
Support divelogs.de exports that include Cyrillic characters
divelogs.de sends us XML files that explicitly state that they are in
ISO-8859-1 encoding (which is true). These files contain the HTML encoded
Cyrillic characters. Once we decode those characters the resulting file is
actually UTF-8 encoded (which is a superset of ISO-8859-1). That seriously
confuses libxml when it tries to parse things.
So instead recognize divelogs.de files and skip the encoding declaration
for them before decoding the HTML encoded non-ISO-8859-1 characters.
This does show, however, that divelogs.de incorrectly truncates the
encoded strings (at least in some sample data that I created the parsing
throws errors because of that).
Reported-by: Sergey Starosek <sergey.starosek@gmail.com>
Based-on-code-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/divelogs.xslt')
-rw-r--r-- | xslt/divelogs.xslt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xslt/divelogs.xslt b/xslt/divelogs.xslt index f66ffccfe..c0585a540 100644 --- a/xslt/divelogs.xslt +++ b/xslt/divelogs.xslt @@ -1,7 +1,7 @@ <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:strip-space elements="*"/> - <xsl:output method="xml" indent="yes"/> + <xsl:output method="xml" indent="no" encoding="UTF-8" omit-xml-declaration="yes"/> <xsl:template match="/"> <divelog program='subsurface-import' version='2'> |