SAP Knowledge Base Article - Preview

1970481 - How to insert Unicode (UTF-8) and other multi-language character data into a SQL Anywhere database and avoid data conversions?


  • When using Unicode data (e.g. data that is encoded with Universal Character Set Transformation Format: 8-bit (UTF-8)) or multi-language data with SQL Anywhere, it can be difficult to insert the character data into the database and avoid character data conversion issues.
  • SQL statements are always interpreted using the database's character set, despite the client interface to which the SQL text arrived into the server. Attempting to directly insert multi-language character data in an INSERT statement:
     INSERT INTO t1 (c1) VALUES ('UTF8-Data-ḁæῐ');
    may result in a database character data conversion operation during the INSERT - any data appearing in the quoted value of the INSERT will automatically be converted to the database's character set.
  • By default, the current OS character set is used for the character set of the database at initialization time.
  • If the database character set is not UTF-8 / Unicode Collation Algorithm (UCA) with UTF-8 encoding or the database character set cannot represent the characters specified, the characters will be converted to the character set, which may result in unreadable characters being stored into the database ('?', 0x1A, etc.). The incorrect transformation of character data to an unsupported character set is commonly known as "mojibake".



SAP Sybase SQL Anywhere (all versions, all platforms)


SAP SQL Anywhere 16.0 ; SAP SQL Anywhere, cloud edition 1.0 ; SAP Sybase SQL Anywhere 12.0 ; Sybase SQL Anywhere 10.0 ; Sybase SQL Anywhere 11.0


11604287 , KBA , BC-SYB-SQA , SQL Anywhere (on premise, on demand) , How To

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.