W3C home > Mailing lists > Public > www-archive@w3.org > July 2002

Re: CWM bug + RFE: N3 to XML RDF fails on non-trivial Unicode

From: Sean B. Palmer <sean@mysterylights.com>
Date: Fri, 5 Jul 2002 22:12:51 +0100
Message-ID: <011c01c22468$bcd6fd00$35560150@localhost>
To: "Dan Connolly" <connolly@w3.org>, "Sampo Syreeni" <decoy@iki.fi>
Cc: "Tim Berners-Lee" <timbl@w3.org>, <www-archive+n3bugs@w3.org>

> I'm not sure I have time to hunt it down soon;
> let me know if you find the bug or a patch.

Replace:-

            write(s[i:])

in def xmldata in notation3.py with:-

            write(re.sub(r'([\x80-\xff])', 
                  lambda m: '&#x%02X;' % ord(m.group(1)), str(s[i:])))

then you get output like:-

$ cat /home/utf8lit.n3 | cwm --rdf

[...]
<rdf:RDF xmlns="file:/home/2000/#"
    xmlns:log="http://www.w3.org/2000/10/swap/log#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

    <con_Address rdf:about="#unique_0000000000000015">
        <con_Street>K&#xC3;&#xA4;mnerintie 4 A 22</con_Street>
    </con_Address>
</rdf:RDF>

Cheers,

-- 
Kindest Regards,
Sean B. Palmer
@prefix : <http://purl.org/net/swn#> .
:Sean :homepage <http://purl.org/net/sbp/> .
Received on Friday, 5 July 2002 17:13:03 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:42:08 UTC