Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple question about UTF-16

Status
Not open for further replies.

Nestor23

Programmer
Apr 4, 2003
7
GB
Could anyone pls tell me how to convert a CString text to UTF-16? I'm using a _UNICODE compilation.

Thanx,

Nestor
 
UTF-16 is simple 2-bytes encoding, is that not what you have in CString? You must care only about very first word in UTF-16 file, which defines endianity.
 
You need one of those strange double casts which calls a conversion operator since CString only has a LPCTSTR conversion and not a LPTSTR conversion.

eg

CString seeString;
...
UTF16* ooTiff;

ooTiff = (UTF16*)(LPCTSTR)seeString;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top