http://llvm.org/bugs/show_bug.cgi?id=15579
Bug ID: 15579
Summary: Incorrect handling of piped string containing 0xFF
Product: libc++
Version: unspecified
Hardware: Macintosh
OS: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 10232
--> http://llvm.org/bugs/attachment.cgi?id=10232&action=edit
300-utf8-ff.t File containing 0xFF
On Mac OS x 10.8.3, with latest XCode and command line tools.
--- main.cpp ----
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
using namespace std;
int main(int argc, char ** argv)
{
ostringstream oss;
oss << cin.rdbuf();
string inputString = oss.str();
cout << "size: " << inputString.size() << endl;
return 0;
}
This is correct output:
> clang main.cpp -lstdc++
> ./a.out < 300-utf8-ff.t
Size: 3
This is incorrect output:
> clang main.cpp -lstdc++ -stdlib=libc++
> ./a.out < 300-utf8-ff.t
Size: 1
300-utf8-ff.t contains a\xFFb.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs