This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: libiconv for windres



> -----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

Attachment: binutil.tk-ds.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]