VOS.VirtODBCJDBCUTF8Set

  • Topic
  • Discussion
  • VOS.VirtODBCJDBCUTF8Set(1.1) -- DAVWikiAdmin? , 2017-06-13 05:41:17 Edit WebDAV System Administrator 2017-06-13 05:41:17

    Set utf8 for ODBC or JDBC connections


     'charset=utf-8' 
    

    JDBC Driver

    The connect option for charset of the JDBC driver causes java string object to be sent as utf8 to server where it will be written as utf8 encoded narrow string into rdf object and respectively into rdf store. The process is a bit complicated but essentially the string comes to server as utf8. In situation where a narrow charset is used the string object will be encoded in the narrow charset string, we don't want this when working against rdf since it works with utf8, thus this special connection option from above should be used.

    ODBC Driver

    As for ODBC, the client should not set a special charset, then utf8 will be sent to client as is and rdf store will receive utf8 string, will be same as in java, just redland driver must ensure what comes in to be utf8 or to be recoded as utf8. When getting string from rdf back to odbc it will be utf8 string, thus on output redland driver should take care to recode or just return utf8 depends how interface of redland is. That said, odbc when send a utf8 to server and uses default server encoding server will get utf8 , when asking for this data will get same back i.e. utf8. As for NVARCHAR cols and utf8, if nvarchar needs to be utilized, then charset_recode needs to be used on client side with current server/driver, but this not affects rdf store dml and queries.