Commit b12f8a3b authored by claes's avatar claes

Function to convert to utf8 without translation added

parent 32ecbf66
/** /**
* Proview $Id: co_wow_gtk.cpp,v 1.10 2007-07-20 11:35:58 claes Exp $ * Proview $Id: co_wow_gtk.cpp,v 1.11 2007-10-30 07:47:33 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -872,6 +872,21 @@ char *CoWowGtk::translate_utf8( char *str) ...@@ -872,6 +872,21 @@ char *CoWowGtk::translate_utf8( char *str)
return result; return result;
} }
char *CoWowGtk::convert_utf8( char *str)
{
static char result[400];
gchar *s;
s = g_convert( str, -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL);
if ( s) {
strncpy( result, s, sizeof(result));
g_free( s);
}
else
strcpy( result, "");
return result;
}
static void modaldia_button1_cb( GtkWidget *w, gpointer data) static void modaldia_button1_cb( GtkWidget *w, gpointer data)
{ {
*(int *)data = wow_eModalDialogReturn_Button1; *(int *)data = wow_eModalDialogReturn_Button1;
......
/** /**
* Proview $Id: co_wow_gtk.h,v 1.3 2007-07-20 11:35:58 claes Exp $ * Proview $Id: co_wow_gtk.h,v 1.4 2007-10-30 07:47:33 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -116,6 +116,7 @@ class CoWowGtk : public CoWow { ...@@ -116,6 +116,7 @@ class CoWowGtk : public CoWow {
static void warranty_cb( GtkWidget *w, gint response, gpointer data); static void warranty_cb( GtkWidget *w, gint response, gpointer data);
static void license_cb( GtkWidget *w, gint response, gpointer data); static void license_cb( GtkWidget *w, gint response, gpointer data);
static char *translate_utf8( char *str); static char *translate_utf8( char *str);
static char *convert_utf8( char *str);
#if 0 #if 0
static void error_ok_cb(Widget w); static void error_ok_cb(Widget w);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment