why the Chinese characters show as clobbers using xml Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
swmp
Experienced Solver
Experienced Solver
Posts: 84
Joined: Tue Mar 21, 2006 1:08 pm

why the Chinese characters show as clobbers using xml

Post by swmp »

i write the src file like this

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?>

<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.3.0.1">

<object class="wxMenuBar" name="main_menu">
<style>wxMB_DOCKABLE</style>
    <object class="wxMenu" name="file_tool_or_menuitem">
        <label>_File</label>
        <style>wxMENU_TEAROFF</style>
        <object class="wxMenuItem" name="unload_resource_menuitem">
            <label>_(汉字)\tCtrl-U</label>
            <help>Unload basic dialog resource</help>
        </object>
        <object class="wxMenuItem" name="reload_resource_menuitem">
            <label>_(汉字)\tCtrl-R</label>
            <help>Reload basic dialog resource</help>
        </object>
        <object class="wxMenuItem" name="exit_tool_or_menuitem">
            <label>E_xit\tAlt-X</label>
            <help>Exit this application</help>
        </object>
    </object>    

</resource>


the Chinese characters show as clobbers ??


thx
Cris
Experienced Solver
Experienced Solver
Posts: 58
Joined: Thu Feb 17, 2005 2:40 pm

Re

Post by Cris »

I am not sure if you are using the correct encoding "ISO-8859-1". Supporting Chinese characters I guess you may need the encoding "UTF-8".

Cris
swmp
Experienced Solver
Experienced Solver
Posts: 84
Joined: Tue Mar 21, 2006 1:08 pm

Post by swmp »

"UTF-8" also show as clobbers
Cris
Experienced Solver
Experienced Solver
Posts: 58
Joined: Thu Feb 17, 2005 2:40 pm

Re

Post by Cris »

If you want your widgets application to be able to show correct Chinese Characters, make sure your system has been changed to Simplified Chinese or Traditional Chinese. On Win XP->Settings->Control Panel->Regional and Language Options, change your system to Chinese, make sure you have Chinese fonts installed. (If you don't understand Chinese, you may not be able to change it back :lol: )

Or you could change to Chinese System easily if you have a Mac.
swmp
Experienced Solver
Experienced Solver
Posts: 84
Joined: Tue Mar 21, 2006 1:08 pm

Post by swmp »

yes , i know chinese very well,and can show Chinese characters well in the application,.

it is only the forms created by src files show Chinese characters as clobbers . n
chris
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Oct 08, 2004 2:05 pm
Location: Europe

Post by chris »

Is wxWidgets compiled in Unicode mode?
How did you build it or which package do you use?
this->signature=NULL;
swmp
Experienced Solver
Experienced Solver
Posts: 84
Joined: Tue Mar 21, 2006 1:08 pm

Post by swmp »

I use the wxDevcpp, and wxXmlResource to read the xrc file
chris
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Oct 08, 2004 2:05 pm
Location: Europe

Post by chris »

If you are using a vanilla wxDevcpp install then you are using an ANSI build. Download and install the Unicode release devpak from this thread and then try again.
this->signature=NULL;
swmp
Experienced Solver
Experienced Solver
Posts: 84
Joined: Tue Mar 21, 2006 1:08 pm

Post by swmp »

i try to install the /wxWidgets262_unicode_gcc.DevPak and wxWidgets262_unicode_debug_gcc.DevPak, but they both show this
Image
swmp
Experienced Solver
Experienced Solver
Posts: 84
Joined: Tue Mar 21, 2006 1:08 pm

Post by swmp »

when i compile in msvc6 in win32 Unicode Release, the exe show Chinese characters well . but the wxDevcpp??
chris
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Oct 08, 2004 2:05 pm
Location: Europe

Post by chris »

If it works with Visual C++ in Unicode mode, then it's indeed an Unicode issue. Installing a Unicode devpack for wxDevCpp should make it work there, too. I honestly don't know why you are getting this error message, so I propose you ask for help in the wxDevCpp subforum on this board.

Good luck!
this->signature=NULL;
lowjoel
Part Of The Furniture
Part Of The Furniture
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel »

my devpaks (see the wxDev-C++ for Visual C++ thread in the wxDevC++ forum) are built with Unicode support, you can use them. But please read the readme in the thread.
swmp
Experienced Solver
Experienced Solver
Posts: 84
Joined: Tue Mar 21, 2006 1:08 pm

Post by swmp »

i sloved it by using this

Code: Select all

wxXmlResource::Get()->SetFlags(0);
See:
http://www.wxwidgets.org/faqcmn.htm#xrclocale

and
http://forums.wxwidgets.org/viewtopic.p ... =east+asia
Post Reply