[Boost-users] Locale on Mac OS X

117 views
Skip to first unread message

Alberto Simões

unread,
Oct 12, 2011, 11:34:36 AM10/12/11
to boost...@lists.boost.org
Hello, friends

I am kind of desesperate.

I am trying to use a Natural Language Processing application written
in C++ that uses libboost on my Mac OS X.

The problem is that locales seem to be broken for C++ in darwin. I
know that is is (as far as I can tell) libboost fault. If you run the
c++ program in attach under Leopard, you get the behavior I paste
below.

My question is: anybody found a way to make locale working on darwin?
Couldn't libboost try to implement an indirection level for mac os X
using the C locale API? (not sure if you are interested, just an
idea).

Please let me know if there is a solution to this problem.

Kindest regards,
Alberto

[ambs@rachmaninoff tmp]$ ./a.out
Trying c locales...
Succeeded in calling setlocale(LC_ALL, "C")
Succeeded in calling setlocale(LC_ALL, "POSIX")
Succeeded in calling setlocale(LC_ALL, "en_US")
Succeeded in calling setlocale(LC_ALL, "en_US.UTF-8")
Succeeded in calling setlocale(LC_ALL, "pl_PL")
Succeeded in calling setlocale(LC_ALL, "pl_PL.ISO8859-2")

Trying C++ locales...
Succeeded ctor for std::locale with "C"
Succeeded ctor for std::locale with "POSIX"
Failed ctor for std::locale with "en_US":
locale::facet::_S_create_c_locale name not valid
Failed ctor for std::locale with "en_US.UTF-8":
locale::facet::_S_create_c_locale name not valid
Failed ctor for std::locale with "pl_PL":
locale::facet::_S_create_c_locale name not valid
Failed ctor for std::locale with "pl_PL.ISO8859-2":
locale::facet::_S_create_c_locale name not valid

--
Alberto Simões

locales.cpp

Daniel James

unread,
Oct 16, 2011, 6:35:49 AM10/16/11
to boost...@lists.boost.org
On Wednesday, 12 October 2011, Alberto Simões wrote:

My question is: anybody found a way to make locale working on darwin?
Couldn't libboost try to implement an indirection level for mac os X
using the C locale API? (not sure if you are interested, just an
idea).

I'm not sure if this will meet your needs but the upcoming release of boost will include a locale library. You can see the documentation at:

Alberto Simões

unread,
Oct 16, 2011, 8:18:38 AM10/16/11
to boost...@lists.boost.org

If it doesn't depend on system locale (didn't have the time to look to
it yet) it might be a solution (if I can convince the package
developer to port his C++ locale code to boost locale).

Thank you.
This might be really helpful.

Alberto
--
Alberto Simões
_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Reply all
Reply to author
Forward
0 new messages