Wireshark-dev: Re: [Wireshark-dev] UTF8 vs. locale in error messages (bug 5715)
From: Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>
Date: Tue, 28 Jun 2011 09:35:47 +0200
On Mon, Jun 27, 2011 at 05:58:35PM -0700, Guy Harris wrote:
> > We have about 240 calls to strerror().
> 
> ...and, unfortunately, a variant that converts to UTF-8 and is API-compatible is non-trivial, 
> as any version that allocates a buffer for the result of the conversion would leak memory 
> we just globally replaced strerror() with ws_strerror().

g_strerror() [1]?

Returns :
  a UTF-8 string describing the error code. If the error code is
  unknown, it returns "unknown error (<code>)". 
  The string can only be used until the next call to g_strerror()

[1] http://developer.gnome.org/glib/2.28/glib-String-Utility-Functions.html#g-strerror