Re: Making a big app, Unicode aware?
I thought:
"If you use a new Visual Studio (2003, 2005), the CString is not part
of MFC
anymore, but is part of ATL and is template based (no library :-)
This means you can freely use a mixture of CStringA and CStringW. "
was your answer to:
<<Is it possible to just do the CString based markup processing in
UTF-8,
and then somehow send the results to the GUI as UTF-16 and get them
back in UTF-16?>>
Well, it was the part that was helpful for me, anyhow. It also seems
like a more sensible answer, because it's an answer to my question,
whereas the other thing was not an answer to my question. I DID say
"markup processing" remember. I did not say uppercasing the string when
the user wants me to uppercase it, because the app does not give the
user a menu to uppercase strings, therefor MakeUpper is not even
called.
Anyhow, it was the more helpful answer, because I've actually done this
now. I've even tested it.
I wrote .cpp file containing something like this:
CStringA UTF8String = "=C3=BC=C3=B1=C3=AE=C3=A7=C3=B8=E2=88=82=C3=A9"; //=
No _T() is used :)
void Something::OnInitDialog {
m_MyControl1.SetWindowText( CString8To16( UTF8String ) );
}
I have a function I wrote CString8To16, using some conversion code I've
adapted from Unicode.org. It's declaration is this:
CStringW CString8To16( CStringA utf8 );
Guess what? It works! The control actually correctly displays
"=C3=BC=C3=B1=C3=AE=C3=A7=C3=B8=E2=88=82=C3=A9" !!
"So no, you did not prove any points." Yes I did, I used reason. Just
because you are unable to correctly identify the exact sentances I used
does not mean I didn't use reason. I COULD go back and copy/paste them
for you, but I think it's a waste of my time. I do remember explaining
that the byte serialisations of UTF-8 do not contain other UTF-8
serialisations, and therefor processing a UTF-8 character as a
string-unit, is identical to processing it as a codepoint for many
purposes. That is proving my point.