CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Apr 2017
    Posts
    9

    codecvt_byname not working on Linux gcc

    gcc 7.1 with C11 linux

    Code:
    fin.imbue(std::locale(fin.getloc(),
                  new std::codecvt_byname<wchar_t, char, std::mbstate_t>("zh_CN.gb18030")));
    produces:
    terminate called after throwing an instance of 'std::runtime_error'
    what(): locale::facet::_S_create_c_locale name not valid
    Aborted (core dumped)

    The code has been taken from:
    http://en.cppreference.com/w/cpp/locale/codecvt_byname

    I have tried as well with with en_US.UTF-8, but the result is the same.
    What is the problem? gcc dies not support localization library?

    Where to find valid list of locale names?
    Last edited by Pancevo1956; September 7th, 2017 at 06:56 AM. Reason: Added code tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured