commonsmachinery / lo-paste-with-credit

GNU General Public License v2.0
1 stars 2 forks source link

Support UTF8-encoded RDF #2

Open artfwo opened 10 years ago

artfwo commented 10 years ago

The plugin assumes that the clipboard data is UTF-16-encoded. The plugin should autodetect clipboard encoding using the BOM in the beginning of RDF string.

petli commented 10 years ago

It's not impossible that the XML library can handle that so that we don't have to. That might also handle the cases where the <?xml encoding="something-wierd"?> is used instead to indicate the encoding.

artfwo commented 10 years ago

Hmm, Python must know the encoding anyway, so it knows how to convert the string to a unicode string. rdflib uses Python's XML libraries, but converts everything to utf-8, check out https://rdflib.readthedocs.org/en/3.2.0/_modules/rdflib/parser.html#create_input_source