Project

General

Profile

Bug #9511

printf family isn't aware of multibyte decimal point characters

Added by Karl Williamson over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
2018-04-28
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

In locales that have this be the radix character, such as ar_AE.UTF-8, things fall apart. The attached short C program demonstrates it.

The UTF-8 representation of this character is the two-byte sequence "\xD9\xAB". But only the first byte is output with a printf "%g", leading to malformed UTF-8.

My guess is that the library just assumes that all radix characters are single-byte.


Files

radix.c (549 Bytes) radix.c Karl Williamson, 2018-04-28 03:01 PM

History

#1

Updated by Yuri Pankov over 1 year ago

Indeed, there are several places in libc where decimal_point is treated as char. Please move the issue to illumos-gate project.

#2

Updated by Marcel Telka over 1 year ago

  • Project changed from OpenIndiana Distribution to illumos gate
  • Category set to lib - userland libraries
#3

Updated by Yuri Pankov over 1 year ago

  • Subject changed from Radix character U+066B ARABIC DECIMAL SEPARATOR doesn't work to printf family isn't aware of multibyte decimal point characters
  • Status changed from New to In Progress
  • Assignee set to Yuri Pankov
  • % Done changed from 0 to 10
  • Difficulty changed from Medium to Bite-size
  • Tags deleted (needs-triage)
#4

Updated by Electric Monk over 1 year ago

  • Status changed from In Progress to Closed
  • % Done changed from 10 to 100

git commit 804635d7bfa86d5f677fada06cb30420313f1159

commit  804635d7bfa86d5f677fada06cb30420313f1159
Author: Yuri Pankov <yuri.pankov@nexenta.com>
Date:   2018-05-16T10:03:43.000Z

    9511 printf family isn't aware of multibyte decimal point characters
    Reviewed by: Dan McDonald <danmcd@joyent.com>
    Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>

#5

Updated by Electric Monk over 1 year ago

git commit f39927996d932d886093624a919a94b0daf5cb83

commit  f39927996d932d886093624a919a94b0daf5cb83
Author: Yuri Pankov <yuripv@yuripv.net>
Date:   2018-05-17T14:43:27.000Z

    9511 printf family isn't aware of multibyte decimal point characters (fix regression)

Also available in: Atom PDF