Project

General

Profile

Actions

Bug #4173

open

OpenIndiana hipster: std::isalpha g++ error

Added by Alexander Pyhalov almost 9 years ago. Updated over 6 years ago.

Status:
New
Priority:
Normal
Category:
-
Target version:
-
Start date:
2013-10-02
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

std::isalpha realization in G++ incorrectly recognizes binary symbols as alphabetic when UTF-8 locale is used.
Attached program can't url-encode string, however it works correctly on Debian Linux 7.0 or FreeBSD 9.
Studio compiler doesn't have this bug. iswalpha() correctly recognizes symbols as non-alphabetic. GCC 3.4 and 4.7 are affected.
Test case is attached.
[pre]
$ g++ tohex.cc -o tohex
$ ./tohex
%88�i%25%3C7��%B80�%3B�%98%BD��%B7Z%94
[/pre]
Coorect output is:
[pre]
$ LANG=C ./tohex
%88%C4i%25%3C7%E9%FC%B80%EA%3B%FF%98%BD%C8%D1%B7Z%94
[/pre]


Files

tohex.cc (1.23 KB) tohex.cc Alexander Pyhalov, 2013-10-02 05:48 PM
test_ctype.cc (554 Bytes) test_ctype.cc Alexander Pyhalov, 2013-10-04 02:52 PM
Actions

Also available in: Atom PDF