[redland-dev] Redland string encoding

Dave Beckett dave at dajobe.org
Sat Sep 22 16:55:17 BST 2007


Sebastian Trüg wrote:
> Hello guys,
> 
> how are strings in redland encoded? I am mainly talking about option strings 
> such as used on librdf_new_storage. Are they in local encoding or utf8?

Strings in Redland are UTF8 with very few exceptions, such as the language
tags for literals like "en-US-ca" which are an ASCII subset and defined by
an IETF RFC.  I can't think of another exception right now.  I would never
use a local encoding.  You can use libiconv, ICU or similar to convert.

There are helper functions to write latin1 from UTF-8 for literals, but
that's all.  (That transformation looses information but it is useful for
testing).

For the python API there are also helpers to turn strings into it's
native UTF-16.

Dave


More information about the redland-dev mailing list