fix for the missing CODESET on openbsd
akir akir
1 files changed,
7 insertions(+),
3 deletions(-)
jump to
M
src/FbTk/Font.cc
→
src/FbTk/Font.cc
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -//$Id: Font.cc,v 1.17 2004/08/31 21:47:56 akir Exp $ +//$Id: Font.cc,v 1.18 2004/08/31 23:07:58 akir Exp $ #include "StringUtil.hh"@@ -252,11 +252,15 @@ if (MB_CUR_MAX > 1) // more than one byte, then we're multibyte
m_multibyte = true; // check for utf-8 mode +#ifdef CODESET char *locale_codeset = nl_langinfo(CODESET); +#else // openbsd doesnt have this (yet?) + char *locale_codeset = 0; +#endif // CODESET - if (strcmp("UTF-8", locale_codeset) == 0) { + if (locale_codeset && strcmp("UTF-8", locale_codeset) == 0) { m_utf8mode = true; - } else { + } else if (locale_codeset != 0) { // if locale isn't UTF-8 we try to // create a iconv pointer so we can // convert non utf-8 strings to utf-8