[ wxwindows-Bugs-1591388 ] wx2.7.1 New wxLocale behaviour

SourceForge.net noreply at sourceforge.net
Mon Nov 6 06:28:47 PST 2006


Bugs item #1591388, was opened at 2006-11-06 15:28
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1591388&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Common
Group: Fatal
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: cecilio (cecilios)
Assigned to: Nobody/Anonymous (nobody)
Summary: wx2.7.1 New wxLocale behaviour

Initial Comment:
Environment: wxWidgets 2.7.1, in Windows (NT also in 
XP). Build 'Unicode Debug' (standard settings). 

My app. is multi-language. Currently there are 
translations for English, Spanish, French and Turkish. 
With wx 2.6.3 I didn't experience any problems and I 
was able to display all four languages in my computer. 
But when testing with 2.7.1 I get a crash if I use 
Turkish.

When loading an image if the file doesn't exits, 
wxImage::LoadImage calls wxLogError( _("Can't load 
image form file ....  . Now (2.7.1) this crashes (in 
my program).

I have traced the problem to file log.cpp, method 
wxLogStderr::DoLogString, the szString parameter is OK 
and contains the above referred string translated into 
Turkish, but line

 fputs(str.mb_str(), m_fp)
 
fails because str.mb_str() returns 0x000000000 
 
After tracing more in depth, the possible problem is 
in strconv.cpp, in method WC2MB. In this method, line

        const size_t len = ::WideCharToMultiByte
                             (
                                m_CodePage,     // 
code page
                                flags,          // 
either none or no best fit
                                pwz,            // 
input string
                                -1,             // it 
is (wide) NUL-terminated
                                buf,            // 
output buffer
                                buf ? n : 0,    // and 
its size
                                NULL,           // 
default "replacement" char
                                pUsedDef        // 
[out] was it used?
                             );

alters the content of flag 'usedDef' and sets it to 1. 
Then later in lines:

                // check if the conversion failed, 
i.e. if any replacements
                // were done
                if ( usedDef )
                    return wxCONV_FAILED;

the method returns wxCONV_FAILED.

Probably, this returned value is not handled properly 
in str.mb_str() and it returns 0x00000. And this 
causes the crash in fputs().

As I said, my code worked perfectly in 2.6.3 in 
Turkish. So I do not know what to do. Any help?



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1591388&group_id=9863




More information about the wx-dev mailing list