Page
Save data to DB
MS SQL DB
List Page
This has to do with your charset: you should find out what charset you are using.
You can then use TextToBinary and BinaryToText to decode your charset.
For instance from UTF-8 to UTF-16 (probably what you need).
I am not sure what charset OS database uses, but i am sure if needed, it can be changed.
Stefano Valente wrote:
Hi Stefano,
I am having the same problem in external database (MSSQL).
I checked the charset for both database (OutSystem MSSQL DB and External MSSQL DB).
They are using the same charset (SQL_Latin1_General_CP1_CI_AS).
However, we can save Chinese character in OutSystems DB but External DB cannot.
Is there any things we need to change on the DB settings?
Also, could you please give some example on how to implement decoding "TextToBinary and BinaryToText"?
Thank you.
I am using destination db with nvarchar but still it is saving as '????'
Anybody can help?
You'd better check which type of your column,. VARCHAR or NVARCHAR ?
If it is VARCHAR with SQL_Latin1_General_CP1_CI_AS with , DB CAN NOT save Chinese.
If it is NVARCHAR, DB can save Unicode include Chinese.
OutSystems use NVARCHAR type, so it can handle Chinese well.
So just use NVARCHAR instead of VARCHAR with your external DB too.
Best Regards
Wei
I am using NVARCHAR in external db still issue is seen everywhere
You need to change your database collation to one that support UTF-8 like Latin1_General_100_CI_AI_SC_UTF8 then Even VARCHAR can store chinese
Facing the same problem, any resolve yet?
Though this is an old thread, for those who are facing similar issue- I also faced this when I was trying to update some data using SQL. Putting an N before the text to be updated resolves the problem. For example:
Update {Sample_Table} set {Sample_Table}.[Chinese_text] = N'为什么翻译有问题' where {Sample_Table}.[Id]=1;
This solved my problem. Hope it helps!!
By Default SQLServer's database collation is SQL_Latin1_General_CP1_CI_AS so when you have the string literal '爛爆' without the N prefix in the query it will use the database's default collation, in this case a non utf-8 collation so it becomes '??'. When you prefix a string literal with N then you are specifically telling SQLServer it is a UTF string.
To solve the issue you will need to change the database collation to Latin1_General_100_CI_AI_SC_UTF8 by issuing the command in SQLServer
ALTER DATABASE MyDatabase COLLATE Latin1_General_100_CI_AI_SC_UTF8;
then you can do any query without N prefix or use any database function (e.g. CreateOrUpdate) provided by Outsystems
When you have database collation Latin1_General_100_CI_AI_SC_UTF8, Varchar, Text will now be able to store UTF-8 values. NVarchar, NText will be always UTF-16 regardless of the database collation.
Hello.
I am not very good at English, please forgive me.
I have confirmed that if you check "Enable Unicode Support" in ServiceCenter in my environment, Japanese input contents are saved in the database.
Please note that I could not find any official documentation if it is actually correct to do this setting.