|
During loading HTML page into HTMLDocument (IHTMLDocument2.write method), how could be launching of scripts in that page prevented?
|
|
|
|
|
I am using MFC (the CDatabase and CRecordset classes) to query a database which has some simple Chinese text stored. My code is built in unicode mode and everything works fine, except that all the chinese characters got converted to the ? character (ascii code 63).
This does not have anything to do with the database because I tried another .NET program with no problem (I was able to get chinese characters from the database). Any help is appreciated. Thanks.
My articles and software tools
|
|
|
|
|
The '?' implies that the Chinese character can't be mapped into the existing encoding (which defaults to Windows-1252). To properly support Unicode data, you should store your data in CString objects (which are UTF-16), or in UTF-8 char* strings. If you choose the latter, you'll need to explicitly transcode() the string using the correct target encoding (i.e. UTF-8).
FYI, I've found a bug in the default (no args) version of the Xerces (C++) transcode() method, which fails silently when it encounters a char that can't be mapped. Instead of replacing an unmapped char with '?' , the method inserts a '\0' , effectively truncating the returned string.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thanks for the info.
I traced into my source code, when I call the CRecordset::GetFieldValue method, a database field is supposed to be read into a CString variable. I checked the actual value, it is already 63s (question marks). That means something happened between the database and the MFC dll which converted the text into question marks.
I am 100% sure that I am building and debugging unicode version of my program.
My articles and software tools
|
|
|
|
|
I use the Classes by Carlos Antolini (ADO)
and have no problem storing and reading cyrilic
unicode strings.
|
|
|
|
|
|
Xiangyang Liu wrote:
That means something happened between the database and the MFC dll which converted the text into question marks.
Yes, or perhaps the app that loaded the database from a Unicode source performed an invalid transcode and stored question marks into the db? I recommend querying the db outside your app to find the culprit.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
It turns out the MFC dll (6.0) does not support ODBC unicode data. The unicode string types SQL_C_WCHAR and SQL_C_WVARCHAR cannot be found from the source code.
The ODBC drivers I used may not support unicode either (version 3.5 or higher is required).
I will have to use ADO or .NET.
My articles and software tools
|
|
|
|
|
|
When you see ? it means a Unicode->ANSI conversion was done, but your current ANSI code page did not contain equivalent characters. WideCharToMultiByte() is the underlying API, and it inserts ? for unconvertible characters.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Four fonts walk into a bar. The bartender says "Hey - get out! We don't want your type in here."
|
|
|
|
|
Thanks, Mike. I read your article about testing unicode programs, it is very helpful.
I suspect this specific problem is in the ODBC driver, it may not support unicode properly or it is misconfigured. I will keep looking tomorrow.
My articles and software tools
|
|
|
|
|
It turns out the MFC dll (6.0) does not support ODBC unicode data. The unicode string types SQL_C_WCHAR and SQL_C_WVARCHAR cannot be found from the source code.
The ODBC drivers I used may not support unicode either (version 3.5 or higher is required).
I will have to use ADO or .NET.
My articles and software tools
|
|
|
|
|
Use the ADO if possible.
We converted from using ODBC to the ADO and it works fine for us - Japanese, Chinese, German, French, Spanish, and English. There may be other languages in use I am not aware, like Russian (Cyrillic text).
Also, I found that the ADO access to the database was much quicker.
|
|
|
|
|
I am trying to Write a Desktop application. I have used alot of char based Program compliers such as Basic, C, Fortran, Pascal, Cobol, Etc...
I am haveing a real tough time understanding the C++ Visual Layout and how it operated with Just writing the code...
Lots of screens and not much information on how or what.
Is there A training Module or is there a step through tutorial. Or maybe even someone that can step me through the basic operation.. Im sure once i grasp the concept and get the Rudementary questions answered I will be off and running...
I am working on a project that reequres me to use this and i need to complete this as quickly with out the cost of cutting corners to complete this project.
Thank you very much.
Rilliams
Rilliams2@cs.com
|
|
|
|
|
Download The PDF[^]
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
I have to create an application to manage the appointments, I have to insert, modify, move, delete any appointment.
Where I can find (or buy) a control like the calendar in outlook 2003?
|
|
|
|
|
www.bcgsoft.com does exactly what you want (and more), but it's unfortunatly not free anymore
There is no spoon.
|
|
|
|
|
I would like an MFC code instead then an ocx.
I would like to show it as outlook 2003 in a view.
By means of the MFC wizard intercept the message.
|
|
|
|
|
BCG library is 100% MFC code for MFC applications.
There is no spoon.
|
|
|
|
|
There is a demo downloadable to verify if it fit to me?
|
|
|
|
|
you can get a demo of the library at the following link:
http://www.bcgsoft.com/download.htm
I'm not doing ad or marketing, but this is one of the best MFC library with Stingray Studio.
There is no spoon.
|
|
|
|
|
It should display the calendar with the appointment as in outlook 2003.
I have download the demo but I have not found a demo that shows the calendar as in appointment of outlook 2003
|
|
|
|
|
Hi,
you can find what you seek with the "BCGPOutlookDemo.exe" which is a demo that shows an outlook 2003 interface and "BCGPIEDemo.exe" in the "Time controls" panel.
Best regards.
There is no spoon.
|
|
|
|
|
Isn't CDateMonthPicker or something exactly what you want? It's one of the common controls. Anything more complicated can't be free...
|
|
|
|
|
I would like to use a control implemented with MCF.
It should display the calendar with the appointment as in outlook 2003
|
|
|
|