468,456 Members | 1,647 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,456 developers. It's quick & easy.

std::strerror and UTF-8

Hi,

I use a library (libphysfs) that calls std::strerror to return a
human-readable error message. According to the docs I read,
std::strerror will return this error message localized and encoded
according to LC_MESSAGES.

Patching the library is no option, so is there any portable way of
obtaining the error message encoded as UTF-8, e.g. by converting it?

Thanks in advance,

Wolf

Jul 3 '06 #1
3 1650
On 3 Jul 2006 09:01:49 -0700, "Wolfgang Meier" <wo***@sofort-mail.de>
wrote:
>I use a library (libphysfs) that calls std::strerror to return a
human-readable error message. According to the docs I read,
std::strerror will return this error message localized and encoded
according to LC_MESSAGES.
Patching the library is no option, so is there any portable way of
obtaining the error message encoded as UTF-8, e.g. by converting it?
What makes you think the returned message is not UTF-8 which is
"backwards compatible with ASCII"? See:
http://en.wikipedia.org/wiki/Utf-8

Best wishes,
Roland Pibinger
Jul 3 '06 #2
Wolfgang Meier wrote:
Hi,

I use a library (libphysfs) that calls std::strerror to return a
human-readable error message. According to the docs I read,
std::strerror will return this error message localized and encoded
according to LC_MESSAGES.

Patching the library is no option, so is there any portable way of
obtaining the error message encoded as UTF-8, e.g. by converting it?

Thanks in advance,

Wolf
If, in fact, you do need to convert, look into the GNU iconv library.
It's a widely used, easy to use character conversion library.

Jul 4 '06 #3
An**********@gmail.com wrote:
Wolfgang Meier wrote:
I use a library (libphysfs) that calls std::strerror to return a
human-readable error message. According to the docs I read,
std::strerror will return this error message localized and encoded
according to LC_MESSAGES.

Patching the library is no option, so is there any portable way of
obtaining the error message encoded as UTF-8, e.g. by converting it?
If, in fact, you do need to convert, look into the GNU iconv library.
It's a widely used, easy to use character conversion library.
Thanks! That did the trick.

Wolf

Jul 4 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by vsgdp | last post: by
32 posts views Thread by Wolfgang Draxinger | last post: by
23 posts views Thread by Steven T. Hatton | last post: by
8 posts views Thread by Divick | last post: by
7 posts views Thread by Jimmy Shaw | last post: by
4 posts views Thread by =?ISO-8859-2?Q?Boris_Du=B9ek?= | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.