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

> 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