[DragonFlyBSD - Bug #3284] (New) Wrong towlower() result for U+038A

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Mon Jun 14 08:43:38 PDT 2021


Issue #3284 has been reported by bhaible.

----------------------------------------
Bug #3284: Wrong towlower() result for U+038A
http://bugs.dragonflybsd.org/issues/3284

* Author: bhaible
* Status: New
* Priority: Normal
* Assignee: 
* Category: Userland
* Target version: 
----------------------------------------
How to reproduce: Run this program.
Expected output:
<pre>
wc1 uppercased = 0x038A, wc2 uppercased = 0x038A
wc1 lowercased = 0x03AF, wc2 lowercased = 0x03AF
</pre>
Actual output:
<pre>
wc1 uppercased = 0x038A, wc2 uppercased = 0x038A
wc1 lowercased = 0x03AF, wc2 lowercased = 0x03B0
</pre>

<pre>
#include <locale.h>
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>

int main ()
{
  if (setlocale (LC_ALL, "fr_FR.UTF-8") == NULL)
    return 1;
  wchar_t wc1 = 0x03AF; /* GREEK SMALL LETTER IOTA WITH TONOS */
  wchar_t wc2 = 0x038A; /* GREEK CAPITAL LETTER IOTA WITH TONOS */
  printf ("wc1 uppercased = 0x%04X, wc2 uppercased = 0x%04X\n", towupper (wc1), towupper (wc2));
  if (towupper (wc1) != towupper (wc2))
    return 2;
  printf ("wc1 lowercased = 0x%04X, wc2 lowercased = 0x%04X\n", towlower (wc1), towlower (wc2));
  if (towlower (wc1) != towlower (wc2))
    return 3;
}
</pre>




-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account



More information about the Bugs mailing list