January 15, 2015 Re: The ANSI character set is very important for operating MSSQL,if no conversion,will attract more C# users | ||||
|---|---|---|---|---|
| ||||
Posted in reply to FrankLike | On Thursday, 15 January 2015 at 14:50:29 UTC, FrankLike wrote:
> The wstring displayed ok in cmd,but not ok in gui(must use the fromMBS fuction),so I want to test change the gui'control.d ,set text property is Tstring ,by verstion(ANSI),set text is wstring ,else ,set text is string.
Ah, ok.
Just keep in mind that if you see missing characters it might be the configuration of your client library that is the problem since newer versions of MSSQL should use UCS2 during transfer. Some libraries convert to less capable character sets such as iso-8859-1 by default.
I believe each varchar column in the database can have a different character set since the database scheme can specify the collation, but nvarchar columns use UCS2. It is generally a good idea to look over your schema and see what is specified if you cannot support unicode.
| |||
January 16, 2015 Re: The ANSI character set is very important for operating MSSQL,if no conversion,will attract more C# users | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Ola Fosheim Grøstad | On Thursday, 15 January 2015 at 16:03:47 UTC, Ola Fosheim Grøstad wrote: > On Thursday, 15 January 2015 at 14:50:29 UTC, FrankLike wrote: >> The wstring displayed ok in cmd,but not ok in gui(must use the fromMBS fuction),so I want to test change the gui'control.d ,set text property is Tstring ,by verstion(ANSI),set text is wstring ,else ,set text is string. > > Ah, ok. > > Just keep in mind that if you see missing characters it might be the configuration of your client library that is the problem since newer versions of MSSQL should use UCS2 during transfer. Some libraries convert to less capable character sets such as iso-8859-1 by default. > > I believe each varchar column in the database can have a different character set since the database scheme can specify the collation, but nvarchar columns use UCS2. It is generally a good idea to look over your schema and see what is specified if you cannot support unicode. I use it :https://github.com/adamdruppe/arsd/blob/master/mssql.d Sorry,I test again, find string displayed ok in 'mssql db' and cmd ,but not ok in gui(must use the fromMBS fuction). And I test charset=UCS2,get error:invalid UTF-8 Exception. Insert data:2 words string("中文") can insert,and display ok in gui,but wstring not work,and 3 words string("中文了") stop work. If insert string("中文") ,display not ok in db,but ok in cmd and gui. | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply