[ https://issues.apache.org/jira/browse/STDCXX-208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Sebor reassigned STDCXX-208:
-----------------------------------
Assignee: Martin Sebor
> codecvt_byname("utf-8@UCS") conversion error
> --------------------------------------------
>
> Key: STDCXX-208
> URL: https://issues.apache.org/jira/browse/STDCXX-208
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 22. Localization
> Affects Versions: 4.1.3, 4.1.2
> Environment: all
> Reporter: Martin Sebor
> Assignee: Martin Sebor
>
> Moved from Rogue Wave bug tracking database:
> ****Created By: sebor @ Oct 12, 2004 06:45:35 PM****
> The program below produces 'conversion error' on stderr when run like so:
> $ echo "abcd" | ./t utf-8@UCS utf-8@UCS
> conversion error
> The expected output is 'abcd'
> #include <iostream>
> #include <locale>
> int main (int argc, char *argv [])
> {
> typedef std::codecvt_byname<wchar_t, char, std::mbstate_t> wcodecvt;
> const char* const from_name = argc > 1 ? argv [1] : "";
> const char* const to_name = argc > 2 ? argv [2] : "";
> const wcodecvt from_cvt (from_name, 1);
> const wcodecvt to_cvt (to_name, 1);
> const std::locale from (std::wcin.getloc (), &from_cvt);
> const std::locale to (std::wcin.getloc (), &to_cvt);
> std::wcin.imbue (from);
> std::wcout.imbue (to);
> std::wcout << std::wcin.rdbuf ();
> if (std::wcout.rdstate ())
> std::cerr << "conversion error\n";
> std::wcout << std::flush;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
|