Changeset de402d4 in git


Ignore:
Timestamp:
16/09/11 04:18:49 (8 years ago)
Author:
Olly Betts <olly@…>
Branches:
add-show-splays, line_contents, master, stereo, svn/github/master, svn/origin/master, svn/tags/1.2.0, svn/tags/1.2.1, svn/tags/1.2.2, svn/tags/1.2.3, svn/tags/1.2.4, svn/tags/1.2.5, svn/trunk, travis-osx
Children:
6001bc1
Parents:
b00a29a
Message:

src/mainfrm.cc: If a label isn't valid UTF-8, treat it as CP1252 (the
Microsoft superset of ISO8859-1).

git-svn-id: file:///home/survex-svn/survex/trunk@3639 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rb00a29a rde402d4  
     1Fri Sep 16 03:16:01 GMT 2011  Olly Betts <olly@survex.com>
     2
     3        * src/mainfrm.cc: If a label isn't valid UTF-8, treat it as CP1252 (the
     4          Microsoft superset of ISO8859-1).
     5
    16Fri Sep 16 03:00:51 GMT 2011  Olly Betts <olly@survex.com>
    27
  • src/mainfrm.cc

    rb00a29a rde402d4  
    11241124                    flags ^= (img_SFLAG_ENTRANCE | LFLAG_ENTRANCE);
    11251125                }
    1126                 LabelInfo* label = new LabelInfo(pt, wxString(survey->label, wxConvUTF8), flags);
     1126                wxString s(survey->label, wxConvUTF8);
     1127                if (s.empty()) {
     1128                    // If label isn't valid UTF-8 then this conversion will
     1129                    // give an empty string.  In this case, assume that the label
     1130                    // is CP1252 (the Microsoft superset of ISO8859-1).
     1131                    static wxCSConv ConvCP1252(wxFONTENCODING_CP1252);
     1132                    s = wxString(survey->label, ConvCP1252);
     1133                }
     1134                LabelInfo* label = new LabelInfo(pt, s, flags);
    11271135                if (label->IsEntrance()) {
    11281136                    m_NumEntrances++;
Note: See TracChangeset for help on using the changeset viewer.