libiconv for windres

Danny Smith dannysmith@clear.net.nz
Sun Jun 3 10:42:00 GMT 2007



> -----Original Message-----
> Ok I added the __CYGWIN__ clause to allow windows API for cygwin too.
> 
> Cheers,
>  i.A. Kai Tietz
> 

Kia Ora
Kai,  I do appreciate the work you've done on this. However there are several problems in winduni.c 
that prevent compilation for windows target.

Some of these appear to be just simple typos. But others, in wind_MultiByteToWideChar
and wind_WideCharToMultiByte  look like more serious cut-and-paste errors.  I have tried to correct in attached patch. 

I am not 100% certain of correct dwFlags for WideCharToMultiByte but considering the problems with some codepages (eg UTF-7)and non-default flags for invalid chars, I think the safest thing is to just use default flags for now, rather than always use '_' as substitute for invalid chars.

Also, I think we do need to set MB_ERR_INVALID_CHARS flag (which I've doen in attached patch) on MultiByteToWideChar and check for and report invalid char errors (which I have not done yet) rather than fail silently.  Finally, please be aware of UTF-8 & UTF-7 conversion problems on ancient W95 systems in absence on MS 'Layer for Unicode'

There are some secutity issues with input buffer sizes that need to be tested
 http://msdn2.microsoft.com/en-us/library/ms776406.aspx
I haven't looked at these in your patch yet.  Perhaps you already have done.


I assume that the currently unused funcions in your winduni.c have a use in your message compiler. Is that correct?  

Cheers

Danny
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutil.tk-ds.diff
Type: application/octet-stream
Size: 3155 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20070603/72facb9a/attachment.obj>


More information about the Binutils mailing list