Project

General

Profile

Actions

Bug #13412

closed

towlower(0x038A) is broken

Added by Bruno Haible over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:

Description

towlower (0x038A) returns 0x03B0. According to the Unicode mapping tables, it should return 0x03AF instead.

Found in OpenIndiana Hipster 20171031.

How to reproduce:
$ gcc -Wall foo.c
$ ./a.out

Expected result:
towlower (0x038A) = 0x03AF
towupper (0x038A) = 0x038A
towlower (0x03AF) = 0x03AF
towupper (0x03AF) = 0x038A
towlower (0x03B0) = 0x03B0
towupper (0x03B0) = 0x03B0

Actual result:
towlower (0x038A) = 0x03B0
towupper (0x038A) = 0x038A
towlower (0x03AF) = 0x03AF
towupper (0x03AF) = 0x038A
towlower (0x03B0) = 0x03B0
towupper (0x03B0) = 0x03B0


Files

foo.c (607 Bytes) foo.c Test case Bruno Haible, 2020-12-30 03:25 PM
check-towlower.c (850 Bytes) check-towlower.c Andreas Wacknitz, 2020-12-30 04:08 PM
Actions #1

Updated by Andreas Wacknitz over 2 years ago

I have adapted your program to your expected results output and for me everything looks correct.
I have used gcc-10 because gcc-7 (the default) complains about the format (X instead of lX being used) but the results are the same for both compilers:

╭─andreas@skoll ~
╰─➤ gcc-10 --version
gcc-10 (OpenIndiana 10.2.0-oi-1) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

╭─andreas@skoll ~
╰─➤ gcc-10 check-towlower.c
╭─andreas@skoll ~
╰─➤ ./a.out
towlower (0x038A) = 0x03AF, (expected 0x03AF)
towupper (0x038A) = 0x038A, (expected 0x038A)
towlower (0x03AF) = 0x03AF, (expected 0x03AF)
towupper (0x03AF) = 0x038A, (expected 0x038A)
towlower (0x03B0) = 0x03B0, (expected 0x03B0)
towupper (0x03B0) = 0x03B0, (expected 0x03B0)

Actions #2

Updated by Bruno Haible over 2 years ago

Good. That means, the bug is already fixed in the current version.

Actions #3

Updated by Andreas Wacknitz over 2 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF