Ticket #237: sg_unicode.patch

File sg_unicode.patch, 2.0 KB (added by fthomas, 17 years ago)
  • clientgui/SkinManager.cpp

     
    12071207    // First we try the users canonical locale resources.
    12081208    //  i.e. en_US
    12091209    retval = ERR_XML_PARSE;
    1210     p = fopen(ConstructSkinFileName().c_str(), "r");
     1210    p = fopen((const char*)wxString(ConstructSkinFileName().c_str(), wxConvUTF8).c_str(), "r");
    12111211    if (p) {
    12121212        mf.init_file(p);
    12131213        retval = Parse(mf, strDesiredLocale);
     
    12181218    //   locale.
    12191219    //  i.e. en
    12201220    if (ERR_XML_PARSE == retval) {
    1221         p = fopen(ConstructSkinFileName().c_str(), "r");
     1221        p = fopen((const char*)wxString(ConstructSkinFileName().c_str(), wxConvUTF8).c_str(), "r");
    12221222        if (p) {
    12231223            mf.init_file(p);
    12241224            retval = Parse(mf, strDesiredLocale.Left(2));
     
    12291229    // If we failed the second lookup try english
    12301230    //  i.e. en
    12311231    if (ERR_XML_PARSE == retval) {
    1232         p = fopen(ConstructSkinFileName().c_str(), "r");
     1232        p = fopen((const char*)wxString(ConstructSkinFileName().c_str(), wxConvUTF8).c_str(), "r");
    12331233        if (p) {
    12341234            mf.init_file(p);
    12351235            retval = Parse(mf, wxT("en"));
     
    13431343
    13441344    // Look for the begining of the desired locale.
    13451345    while (in.fgets(buf, 256)) {
    1346         if (match_tag(buf, strLocaleStartTag.c_str())) {
     1346        if (match_tag(buf, (const char*)wxString(strLocaleStartTag.c_str(), wxConvUTF8).c_str())) {
    13471347            bLocaleFound = true;
    13481348            break;
    13491349        }
     
    13521352    if (!bLocaleFound) return ERR_XML_PARSE;
    13531353
    13541354    while (in.fgets(buf, 256)) {
    1355         if (match_tag(buf, strLocaleEndTag.c_str())) break;
     1355        if (match_tag(buf, (const char*)wxString(strLocaleEndTag.c_str(), wxConvUTF8).c_str())) break;
    13561356        else if (match_tag(buf, "<simple>")) {
    13571357            m_SimpleSkin.Parse(in);
    13581358            continue;