digitalmars.D - The ANSI character set is very important for operating MSSQL,if no
- FrankLike (8/8) Jan 13 2015 The ANSI character set is very important for operating MSSQL, if
- Mike Parker (6/13) Jan 13 2015 This has nothing to do with ANSI, and everything to do with multibyte
- Brad Anderson (5/13) Jan 13 2015 If by ANSI you mean codepage-1252 we actually have that in the
- FrankLike (5/21) Jan 13 2015 Thank you.
- "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= (3/6) Jan 14 2015 MSSQL supports UCS2 (16 bit unicode) for nvarchar and you should
- FrankLike (4/10) Jan 14 2015 ' set the connection to UTF-8'? MSSQL? How to do? But I only know
- "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= (5/16) Jan 14 2015 Just search for it.
- FrankLike (3/20) Jan 14 2015 Not a good idea.
- "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= (6/7) Jan 14 2015 What is not a good idea? The default collation differs based on
- FrankLike (6/13) Jan 15 2015 The wstring displayed ok in cmd,but not ok in gui(must use the
- "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= (12/16) Jan 15 2015 Ah, ok.
- FrankLike (11/27) Jan 16 2015 I use it :https://github.com/adamdruppe/arsd/blob/master/mssql.d
The ANSI character set is very important for operating MSSQL, if no conversion, will expand the scope of D users, that can attract Now, the data comming from MsSql must convert by 'fromMBS' or 'toMBSz',it's not convenient to operate DataBase. Do you think a string that named 'Astring' which means 'ANSI' string is good for D? Thank you.
Jan 13 2015
On 1/14/2015 1:47 AM, FrankLike wrote:The ANSI character set is very important for operating MSSQL, if no users.Not likely.Now, the data comming from MsSql must convert by 'fromMBS' or 'toMBSz',it's not convenient to operate DataBase. Do you think a string that named 'Astring' which means 'ANSI' string is good for D?This has nothing to do with ANSI, and everything to do with multibyte character sets. Besides which, there always must be a to/from something when converting between D strings and C strings, no matter what format the C string is in.
Jan 13 2015
On Tuesday, 13 January 2015 at 16:47:33 UTC, FrankLike wrote:The ANSI character set is very important for operating MSSQL, if no conversion, will expand the scope of D users, that can Now, the data comming from MsSql must convert by 'fromMBS' or 'toMBSz',it's not convenient to operate DataBase. Do you think a string that named 'Astring' which means 'ANSI' string is good for D? Thank you.If by ANSI you mean codepage-1252 we actually have that in the frequently overlooked std.encoding. http://dlang.org/library/std/encoding/windows1252_string.html http://dlang.org/library/std/encoding/EncodingSchemeWindows1252.html
Jan 13 2015
On Wednesday, 14 January 2015 at 02:08:21 UTC, Brad Anderson wrote:On Tuesday, 13 January 2015 at 16:47:33 UTC, FrankLike wrote:Thank you. I get data by arsd from MsSql,it can display string ok in cmd,but not work ok on gui.The ANSI character set is very important for operating MSSQL, if no conversion, will expand the scope of D users, that can Now, the data comming from MsSql must convert by 'fromMBS' or 'toMBSz',it's not convenient to operate DataBase. Do you think a string that named 'Astring' which means 'ANSI' string is good for D? Thank you.If by ANSI you mean codepage-1252 we actually have that in the frequently overlooked std.encoding. http://dlang.org/library/std/encoding/windows1252_string.html http://dlang.org/library/std/encoding/EncodingSchemeWindows1252.html
Jan 13 2015
On Tuesday, 13 January 2015 at 16:47:33 UTC, FrankLike wrote:The ANSI character set is very important for operating MSSQL, if no conversion, will expand the scope of D users, that canMSSQL supports UCS2 (16 bit unicode) for nvarchar and you should be able to set the connection to UTF-8.
Jan 14 2015
On Wednesday, 14 January 2015 at 13:44:39 UTC, Ola Fosheim Grøstad wrote:On Tuesday, 13 January 2015 at 16:47:33 UTC, FrankLike wrote:' set the connection to UTF-8'? MSSQL? How to do? But I only know it ok in mySql. Thank you.The ANSI character set is very important for operating MSSQL, if no conversion, will expand the scope of D users, that canMSSQL supports UCS2 (16 bit unicode) for nvarchar and you should be able to set the connection to UTF-8.
Jan 14 2015
On Wednesday, 14 January 2015 at 15:37:20 UTC, FrankLike wrote:On Wednesday, 14 January 2015 at 13:44:39 UTC, Ola Fosheim Grøstad wrote:Just search for it. https://www.google.no/?q=mssql%20connection%20utf-8 First hit: http://stackoverflow.com/questions/1322421/php-sql-server-how-to-set-charset-for-connectionOn Tuesday, 13 January 2015 at 16:47:33 UTC, FrankLike wrote:' set the connection to UTF-8'? MSSQL? How to do? But I only know it ok in mySql. Thank you.The ANSI character set is very important for operating MSSQL, if no conversion, will expand the scope of D users, that canMSSQL supports UCS2 (16 bit unicode) for nvarchar and you should be able to set the connection to UTF-8.
Jan 14 2015
On Wednesday, 14 January 2015 at 15:56:14 UTC, Ola Fosheim Grøstad wrote:On Wednesday, 14 January 2015 at 15:37:20 UTC, FrankLike wrote:Not a good idea.On Wednesday, 14 January 2015 at 13:44:39 UTC, Ola Fosheim Grøstad wrote:Just search for it. https://www.google.no/?q=mssql%20connection%20utf-8 First hit: http://stackoverflow.com/questions/1322421/php-sql-server-how-to-set-charset-for-connectionOn Tuesday, 13 January 2015 at 16:47:33 UTC, FrankLike wrote:' set the connection to UTF-8'? MSSQL? How to do? But I only know it ok in mySql. Thank you.The ANSI character set is very important for operating MSSQL, if no conversion, will expand the scope of D users,MSSQL supports UCS2 (16 bit unicode) for nvarchar and you should be able to set the connection to UTF-8.
Jan 14 2015
On Wednesday, 14 January 2015 at 16:44:35 UTC, FrankLike wrote:Not a good idea.What is not a good idea? The default collation differs based on the OS settings AFAIK. In western countries it probably is ISO8859-1 (not a windows code page, but close). Unicode data is UCS2LE (little endian), but if you get the settings right the client library should allow you to use UTF-8.
Jan 14 2015
On Wednesday, 14 January 2015 at 17:19:42 UTC, Ola Fosheim Grøstad wrote:On Wednesday, 14 January 2015 at 16:44:35 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.Not a good idea.What is not a good idea? The default collation differs based on the OS settings AFAIK. In western countries it probably is ISO8859-1 (not a windows code page, but close). Unicode data is UCS2LE (little endian), but if you get the settings right the client library should allow you to use UTF-8.
Jan 15 2015
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.
Jan 15 2015
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: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.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.
Jan 16 2015