std::locale breakage on MacOS 10.6 with LANG=en_US.UTF-8

后端 未结 5 2277
你的背包
你的背包 2020-12-06 01:12

I have a C++ application that I am porting to MacOSX (specifically, 10.6). The app makes heavy use of the C++ standard library and boost. I recently observed some breakage i

5条回答
  •  不思量自难忘°
    2020-12-06 01:53

    The _S_create_c_locale exception seems to indicate some sort of misconfiguration: check that whatever your LC_ALL or LANG environment variable is set to, exists in the output of locale -a.

    $ env LC_ALL=xx_YY ./test
    terminate called after throwing an instance of 'std::runtime_error'
      what():  locale::facet::_S_create_c_locale name not valid
    Aborted
    $ env LC_ALL=C ./test
    $ echo $?
    0
    

    But since you're on OS X, I'm not really sure how locale information is supposed to be handled.

提交回复
热议问题