[PATCH 3/3] msvcrt: Make wcstoi64 support various Unicode digits.

Lauri Kenttä lauri.kentta at gmail.com
Wed Dec 14 10:27:37 CST 2016


On 2016-12-14 16:59, Henri Verbeet wrote:
> On 14 December 2016 at 15:54, Nikolay Sivov <nsivov at codeweavers.com> 
> wrote:
>> On 12/14/2016 05:45 PM, Lauri Kenttä wrote:
>>> On 2016-12-14 12:23, Henri Verbeet wrote:
>>>> For what it's worth, note also that Wine has wine_fold_string(), 
>>>> which
>>>> should be consistent with FoldString().
>>> 
>>> 
>>> I don't see what FoldString could do here.
>> 
>> MAP_FOLDDIGITS looks relevant to what you're doing.
>> 
> Yeah. MAP_FOLDDIGITS will map the various unicode digits to 0-9. It
> does that based on the unicode tables, which means you wouldn't have
> to maintain a separate list of unicode digit ranges in msvcrt. That
> assumes wcstoi64() is consistent with FoldString(), which of course it
> may not be.

Unfortunately MAP_FOLDDIGITS seems to map too many things (e.g. Tamil,
which is already tested and shouldn't work).

I've now verified the list of zeros with the obvious test program:

WCHAR buf[4] = {0}, *end;
int i, nl = 0;
for (buf[0] = '0'; buf[0] != 0; ++buf[0]) {
	end = buf;
	i = _wcstoi64(buf, &end, 36);
	if (end != buf) {
		printf("U+%04X = %d\n", buf[0], i);
	}
}

There's no point in including this in my patch, though, I guess.

-- 
Lauri Kenttä



More information about the wine-devel mailing list