Opened 15 years ago

Closed 14 years ago

#1446 closed Bugs (fixed)

POSIX API doesn't use C locale

Reported by: tomaz.solc@… Owned by: John Maddock
Milestone: To Be Determined Component: regex
Version: Boost 1.34.1 Severity: Problem
Keywords: Cc:

Description

When using POSIX interface to boost::wregex :alpha: character class doesn't match non-ASCII alphabetical characters (eventhough C library's iswalpha() function correctly recognizes them).

The attached program returns

1 0

1 1

0 1

on Debian GNU/Linux ("Testing", Boost version 1.33.1). Changing:

setlocale(LC_ALL, "en_US.utf8");

to:

std::locale en("en_US.utf8"); std::locale::global(en);

fixes the problem.

Attachments (1)

boost-alpha.c (496 bytes ) - added by tomaz.solc@… 15 years ago.
Example demonstrating POSIX API problem.

Download all attachments as: .zip

Change History (2)

by tomaz.solc@…, 15 years ago

Attachment: boost-alpha.c added

Example demonstrating POSIX API problem.

comment:1 by John Maddock, 14 years ago

Resolution: fixed
Status: newclosed

(In [46170]) Changed POSIX API functions to use the global C locale. Fixes #1446.

Note: See TracTickets for help on using tickets.