apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 39895] - apr_os_strerror fails on WinCE (or when _UNICODE is set)
Date Thu, 03 May 2007 16:14:57 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39895>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39895





------- Additional Comments From carnold@apache.org  2007-05-03 09:14 -------
I looked hard at trying to address Will Rowe's comments on 2006-09-20, but I
could not come up with a simple solution.  Both patches will address my original
issue (only getting the first letter of any message and possible buffer overrun
on WinCE) without changing the established behavior on other platforms.  I 'd
prefer the in-place transcode over skipping the formatted message, but either is
fine.  

The issue that apr_strerror may not return a UTF-8 encoded message is not a
WinCE specific issue and I've really tried to make no change to behavior on
other platforms in the WinCE patches.  

If there were a pool handy, it would be simple to allocate memory double the
size of the destination buffer, call FormatMessage, and then
apr_conv_ucs2_to_utf8 to transcode to UTF-8.  However,  without a memory pool,
then you are constrained by the buffer available.  Even if you were able to
write a bulletproof in-place transcoder, you would still have the side effect of
reducing the maximum message that can be placed in the buffer by half.  If this
was to be addressed (maybe if APR 2 and got a pool in scope), it should be split
off into a different bug and not hold up the WinCE specific fix.

If your concern was that a caller was expecting UTF-8 and might get a message in
the current default encoding that was not valid UTF-8, you still call
FormatMessageA but walk through the message and replace any code point >= 0x80
with '?'.  However, again that is not something WinCE specific and should be
done under a different bug.

(WinCE does not have FormatMessageA or FormatMessageW, just FormatMessage which
takes LPWSTR regardless of the state of _UNICODE or _MBCS).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message