Hi there,
just a bug report.
Testing environment:
1. windows vista, locale : English (united states)
2. Delphi 7 professional
3. XLSReadWriteII 4
I wrote a simple program to read a content from an Excel file (excel 97--2003). The excel files contains traditional Chinese character. But all I got is simply the question mark: '?'.
Here is what I did:
opened the excel file, started loading the content of the file, in the debug mode I found that the value I obtained using function calls like AsString, AsWideString were all '?', the XLSReadWriteII 4 has not done the correct parsing..
One possible solution is to change the system locale to Chinese but the rigid development requirement is that the locale must be English so let's forget about this solution. Any suggestion will be greately appreciated!
Thanks in advance.
for your testing purpose, you can place this chinese sentence in an excel file and try to read it:
便利超商及麵包店,針對統一麵包所生產的土司
XLSReadWriteII 4 fails to handle Unicode in Delphi7?
Hello
XLSReadWriteII handles unicode characters correct, and always uses the WideString type. But please note that all Delphi versions prior to D2009 don't have any support for displaying unicode characters. All windows controls (TEdit, TListBox etc) are all single byte, and you must convert unicode strings to single byte strings using correct codepage. If you have an Excel file and want to see how XLSReadWriteII interprets the text, you can download the XLSSpreadSheet compiled demo from our site.
XLSReadWriteII handles unicode characters correct, and always uses the WideString type. But please note that all Delphi versions prior to D2009 don't have any support for displaying unicode characters. All windows controls (TEdit, TListBox etc) are all single byte, and you must convert unicode strings to single byte strings using correct codepage. If you have an Excel file and want to see how XLSReadWriteII interprets the text, you can download the XLSSpreadSheet compiled demo from our site.
Lars Arvidsson, Axolot Data
Thank you larsa for your reply.larsa wrote:Hello
XLSReadWriteII handles unicode characters correct, and always uses the WideString type. But please note that all Delphi versions prior to D2009 don't have any support for displaying unicode characters. All windows controls (TEdit, TListBox etc) are all single byte, and you must convert unicode strings to single byte strings using correct codepage. If you have an Excel file and want to see how XLSReadWriteII interprets the text, you can download the XLSSpreadSheet compiled demo from our site.
But what I meant was: I got all '?' immediately after calling XLSReadWriteII 4's AsString (or AsWideString) method. I did this in the debug mode, using the Watch List in Delphi. That means, the value returned from the XLSReadWriteII api is '?' already, that is the problem.
Since my system locale is English, it cannot display some unicode like Chinese character properly. But the expected return value from XLSReadWriteII should be some 'strange symbols' rather than '?'.