[Bug libstdc++/15732] wifstream does not work with UTF-8

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon May 31 13:32:00 GMT 2004


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-30 13:32 -------
Can you provide the error?
Also what do you have set of LC_* and LANG because it is dependent on them.
Also are you sure that you have a libc which supports UTF-8 encoding.

Oh here is the .cc file I derived from the .ii file:
#include <fstream>
#include <iostream>


using namespace std;

int main()
{
  setlocale(LC_ALL, "");
  locale loc("");
  wcin.imbue(loc);
  wcout.imbue(loc);

  wifstream fin("metaportal.def");

  wstring s;
  while (wcin >> s) wcout << s << L" ";
}

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15732



More information about the Gcc-bugs mailing list