By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,171 Members | 1,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,171 IT Pros & Developers. It's quick & easy.

std::strerror and UTF-8

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.