Project

General

Profile

Actions

Bug #3284

open

Wrong towlower() result for U+038A

Added by bhaible over 3 years ago. Updated over 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Userland
Target version:
Start date:
06/14/2021
Due date:
% Done:

0%

Estimated time:

Description

How to reproduce: Run this program.
Expected output:

wc1 uppercased = 0x038A, wc2 uppercased = 0x038A
wc1 lowercased = 0x03AF, wc2 lowercased = 0x03AF

Actual output:
wc1 uppercased = 0x038A, wc2 uppercased = 0x038A
wc1 lowercased = 0x03AF, wc2 lowercased = 0x03B0

#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;
}
Actions

Also available in: Atom PDF