|
@ -26,6 +26,7 @@ |
|
|
#include <ki_exception.h>
|
|
|
#include <ki_exception.h>
|
|
|
#include <wx/strconv.h>
|
|
|
#include <wx/strconv.h>
|
|
|
#include <wx/buffer.h>
|
|
|
#include <wx/buffer.h>
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
/* THROW_IO_ERROR needs this, but it includes this file, so until some
|
|
|
/* THROW_IO_ERROR needs this, but it includes this file, so until some
|
|
|
factoring of THROW_IO_ERROR into a separate header, defer and use the asserts. |
|
|
factoring of THROW_IO_ERROR into a separate header, defer and use the asserts. |
|
@ -203,10 +204,9 @@ UTF8::UTF8( const wchar_t* txt ) |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
size_t len = wcslen( txt ) * 4 + 1; |
|
|
|
|
|
char temp[len]; |
|
|
|
|
|
wxConvUTF8.WC2MB( temp, txt, len ); |
|
|
|
|
|
m_s.assign( temp ); |
|
|
|
|
|
|
|
|
std::vector< char > temp( wcslen( txt ) * 4 + 1 ); |
|
|
|
|
|
wxConvUTF8.WC2MB( temp.data(), txt, temp.size() ); |
|
|
|
|
|
m_s.assign( temp.data() ); |
|
|
} |
|
|
} |
|
|
catch(...) |
|
|
catch(...) |
|
|
{ |
|
|
{ |
|
@ -233,4 +233,4 @@ UTF8& UTF8::operator+=( unsigned w_ch ) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return (UTF8&) *this; |
|
|
return (UTF8&) *this; |
|
|
} |
|
|
|
|
|
|
|
|
} |