Save Chinese to database to become '?'
Question

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:

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.


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

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!!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.