+
+
+// ---------------------------------------------------------------------------
+// wxUniCharRef
+// ---------------------------------------------------------------------------
+
+#if wxUSE_UNICODE_UTF8
+wxUniCharRef& wxUniCharRef::operator=(const wxUniChar& c)
+{
+ wxString::Utf8CharBuffer utf(wxString::EncodeChar(c));
+ size_t lenOld = wxString::GetUtf8CharLength(*m_pos);
+ size_t lenNew = wxString::GetUtf8CharLength(utf[0]);
+
+ if ( lenNew == lenOld )
+ {
+ iterator pos(m_pos);
+ for ( size_t i = 0; i < lenNew; ++i, ++pos )
+ *pos = utf[i];
+ }
+ else
+ {
+ size_t idx = m_pos - m_str.begin();
+
+ m_str.replace(m_pos, m_pos + lenOld, utf, lenNew);
+
+ // this is needed to keep m_pos valid:
+ m_pos = m_str.begin() + idx;
+ }
+
+ return *this;
+}
+#endif // wxUSE_UNICODE_UTF8