Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#873 closed Bugs (Invalid)

Regex for UChar or short on linux-x64

Reported by: towi Owned by: John Maddock
Milestone: Component: regex
Version: None Severity:
Keywords: Cc:

Description

On my Linux-x64 machine, where sizeof(wchar_t) is 4 I want to use regex for ICU UnicodeStrings. Or, in fact on zero-terminated UChar* buffers. 

But the following code crashes with a "bad_cast" exception:

-----------------------------------

#include <boost/regex/v4/regex.hpp> 

typedef unsigned short UChar; // UChar from ICU
typedef boost::basic_regex<UChar> uregex;

int main()
{
    UChar ubuf[] = { 'a', 'b', 'c', 0}; 
    uregex re;
    re.assign(ubuf);
}

---------------------------------------

boost version is 1.35. g++ is 4.1.2.


tschau, towi.


Change History (2)

comment:1 by John Maddock, 16 years ago

Status: assignedclosed
Logged In: YES 
user_id=14804
Originator: NO

Please refer to the documentation here: http://www.boost.org/libs/regex/doc/icu_strings.html and follow the instructions for working with ICU data types.

comment:2 by towi, 16 years ago

Logged In: YES 
user_id=269193
Originator: YES

Thanks a lot! Works. Sorry I missed that.

Note: See TracTickets for help on using tickets.