Max Khon wrote:
> On Wed, Feb 23, 2005 at 10:26:05PM +0000, Andreas Pflug wrote:
>>>Attached patch fixes coredump in non-Unicode version of pgadmin3.
>>>This allows to build (non-Unicode) pgadmin3 on FreeBSD 4.x.
>>This patch appears highly dubious to me (apart from the fact that I'd
>>call non-unicode unsupported).
>>>+ size_t buf_len = nLen;
>>>+ size_t buf_len = nLen * sizeof(wchar_t);
>>(const char*)buffer, (size_t)(nLen+1));
>>wxStringBuffers expects the second parameter to contain the number of
>>characters (not bytes), which will be the same for unicode as and
> No. wxStringBuffer uses wxWCharBuffer in Unicode case and
> wxCharBuffer in non-Unicode case.
Which is the same.
1 character = wchar_t = wxChar = wxWChar in Unicode,
1 character = char = wxChar in non-Unicode.
Anyhow, having a deeper look at wx unicode conversions it seems that (in
contrast to earlier versions) now utf-conversions are supported in
non-unicode too, making that offending line more than a no-op.
Unfortunately, the usage of wxStringBuffer as argument to MB2WC is
*plain wrong*, because writing wchar_t to char is pure bullsh*t for
non-unicode. The code assumes wxChar==wchar_t, which is true in unicode
Which condenses down to "utffile.cpp is not non-unicode compatible".
I've added a #error accordingly. Until utffile is thoroughly reworked
for non-unicode, compiling pgadmin in unicode mode is *required*.
In response to
pgadmin-hackers by date
|Next:||From: Max Khon||Date: 2005-02-24 11:30:24|
|Subject: Re: utffile patch|
|Previous:||From: cvs||Date: 2005-02-24 10:20:01|
|Subject: CVS Commit by andreas: require unicode to compile utffile.cpp|