[PATCH 2/2] msvcrt: Fixed fgetwc behavior on multibyte characters and unicode files

Piotr Caban piotr.caban at gmail.com
Wed Mar 20 04:43:48 CDT 2013


On 03/20/13 09:41, Akihiro Sagawa wrote:
> On Mon, 18 Mar 2013 17:11:04 +0100, Piotr Caban wrote:
>> +        char mbs[2];
> This should be a constant, like MSVCRT_MB_LEN_MAX.
>
>> +        int len = 0;
>> +        ch = MSVCRT_fgetc(file);
>> +        if(ch != MSVCRT_EOF) {
>> +            mbs[0] = (char)ch;
>> +            if(MSVCRT_isleadbyte(mbs[0])) {
> This doesn't work correctly if char is signed. Because _isleadbyte()
> expects the value of unsigned char or EOF as well as other is- functions.
>
> I wrote some fgetwc() tests. Please refer following page:
> https://testbot.winehq.org/JobDetails.pl?Key=24806
I've sent a fixed version. Thank you.

Thanks,
Piotr



More information about the wine-devel mailing list