<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Incorrect handling of piped string containing 0xFF"
   href="http://llvm.org/bugs/show_bug.cgi?id=15579">15579</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect handling of piped string containing 0xFF
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>hhinnant@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sergiy.dubovik@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=10232" name="attach_10232" title="300-utf8-ff.t File containing 0xFF">attachment 10232</a> <a href="attachment.cgi?id=10232&action=edit" title="300-utf8-ff.t File containing 0xFF">[details]</a></span>
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:
<span class="quote">> clang main.cpp -lstdc++
> ./a.out < 300-utf8-ff.t</span >
Size: 3

This is incorrect output:
<span class="quote">> clang main.cpp -lstdc++ -stdlib=libc++
> ./a.out < 300-utf8-ff.t</span >
Size: 1


300-utf8-ff.t contains a\xFFb.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>