Opened 7 years ago
Closed 7 years ago
#11265 closed Bugs (fixed)
boost::algorithm::join produces incorrect results with char16_t
Reported by: | Owned by: | Marshall Clow | |
---|---|---|---|
Milestone: | To Be Determined | Component: | string_algo |
Version: | Boost 1.56.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Calling boost::algorithm::join on char16_t data silently produces corrupted results. This causes strings to have incorrect sizes. This appears to happen because char16_t is not recognized as a character literal type in boost/range/as_literal.hpp.
It does recognize wchar_t, so this problem is not visible where char16_t may be converted to wchar_t. I've observed the problem on gcc 4.7
I've attached a patched version of boost/range/as_literal.hpp and some reproduction code which demonstrates the issue.
The reproduction code creates the string "aa,bb" once using string concatenation and once using join. With concatenation, the size of the string is 5 as expected. With join, the size is 6.
Attachments (2)
Change History (5)
by , 7 years ago
Attachment: | as_literal_repro.cpp added |
---|
comment:1 by , 7 years ago
Status: | new → assigned |
---|
Thanks. I have reproduced this issue on Mac OS X using clang.
comment:3 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
reproduction code