Hey ZhiTao,

2009/8/7 ZhiTao Chen <[email protected]>:
> Thanks Zhimin & Wim,
> I tried Wim's method,It's OK!
> BUT there's another question:
> When I use Chinese message in the alert function, it didn't display
> properly.
> Maybe it's a problem about charset or encoding.

It most certainly is !

> My C++ code is in GB2312,the document.charset is utf-8.
> How to resolve this?

doJavaScript() expects UTF8; it is a low-level method.

The easiest way to get it right is by not relying on the charset
encoding used by your compiler (or indeed your server locale). You can
avoid this by using WStrings stored in XML message resource bundles
(stored in UTF8 or UTF16 format for example), and the use
doJavaScript("alert(" + WString::tr("my-message").jsStringLiteral() +
")");

Regards,
koen

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to