Hello Sebastian, flags are: 0x1 - The string is an IRI (say, RDF ref). It should be UTF-8. 0x2 - The string is supposed to be UTF-8, an error may be signalled if it is not so. 0x4 - The string is supposed to be in default server encoding. This is not used if UTF-8 is default server encoding, 0x2 is used in that case.
A combination 0x3 is not expected, but it may happen due to errors. They're not "supposed to be" UTF-8, they "must" be UTF-8. IRIs must be flagged as 0x1 but sometimes they are flagged as 0x1 | 0x2. So I agree with you, flag & 1 may be safer. Best Regards, Ivan Mikhailov OpenLink Software http://virtuoso.openlinksw.com On Fri, 2009-10-30 at 13:36 +0100, Sebastian Trüg wrote: > The documentation of the Virtuoso RDF ODBC extensions[1] contains an error: > > In the example the box flags are compared to 1 to determine if the result is > a > IRI: > > switch (dvtype) > { > case VIRTUOSO_DV_STRING: > { > if (flag == 1) > > > In fact it needs to be: > > switch (dvtype) > { > case VIRTUOSO_DV_STRING: > { > if (flag & 1) > > At least that is what my experiments showed. I suppose the flags are a bit > field stating that: > 0 - latin1 string > 1 - iri > 2 - utf8 > > Thus, 3, would mean a utf8 encoded IRI, while 2 is a plain utf8 literal and 1 > is a latin1 encoded IRI. > > Cheers, > Sebastian > > [1] http://docs.openlinksw.com/virtuoso/virtodbcsparql.html > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Virtuoso-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/virtuoso-users
