Necessary changes for the previous API/UTF-8 changes.

This commit is contained in:
Moritz Bunkus 2005-01-01 19:37:26 +00:00
parent 6377a9c4ef
commit 7b9392f0c7
3 changed files with 14 additions and 19 deletions

View File

@ -431,24 +431,33 @@ strip(vector<wxString> &v,
string
to_utf8(const wxString &src) {
char *utf8;
string retval;
#if WXUNICODE
char *utf8;
int len;
len = wxConvUTF8.WC2MB(NULL, src.c_str(), 0);
utf8 = (char *)safemalloc(len + 1);
wxConvUTF8.WC2MB(utf8, src.c_str(), len + 1);
#else
utf8 = to_utf8_c(cc_local_utf8, src);
#endif
retval = utf8;
safefree(utf8);
#else
retval = to_utf8(cc_local_utf8, src.c_str());
#endif
return retval;
}
wxString
from_utf8(const wxString &src) {
#if WXUNICODE
return src;
#else
return wxString(from_utf8(cc_local_utf8, src.c_str()).c_str());
#endif
}
wxString
unescape(const wxString &src) {
wxString dst;

View File

@ -92,6 +92,7 @@ wxString join(const wxString &pattern, vector<wxString> &strings);
wxString &strip(wxString &s, bool newlines = false);
vector<wxString> & strip(vector<wxString> &v, bool newlines = false);
string to_utf8(const wxString &src);
wxString from_utf8(const wxString &src);
wxString UTFstring_to_wxString(const UTFstring &u);
wxString unescape(const wxString &src);
wxString format_date_time(time_t date_time);

View File

@ -634,21 +634,6 @@ tab_input::enable_ar_controls(mmg_track_t *track) {
rb_display_dimensions->SetValue(!ar_enabled);
}
static wxString
from_utf8(const wxString &src) {
#if WXUNICODE
return src;
#else
wxString retval;
char *local;
local = from_utf8_c(cc_local_utf8, src.c_str());
retval = local;
safefree(local);
return retval;
#endif
}
void
tab_input::on_add_file(wxCommandEvent &evt) {
wxString media_files;