+const char *wxMBConv_iconv::GetMBNul(size_t *nulLen) const
+{
+ if ( m_nulLen == (size_t)-2 )
+ {
+ wxMBConv_iconv * const self = wxConstCast(this, wxMBConv_iconv);
+
+#if wxUSE_THREADS
+ // NB: explained in MB2WC
+ wxMutexLocker lock(self->m_iconvMutex);
+#endif
+
+ wchar_t *wnul = L"";
+ size_t inLen = sizeof(wchar_t),
+ outLen = WXSIZEOF(m_nulBuf);
+ const char *in = (char *)wnul;
+ char *out = self->m_nulBuf;
+ if ( iconv(w2m, &in, &inLen, &out, &outLen) == (size_t)-1 )
+ {
+ self->m_nulLen = (size_t)-1;
+ }
+ else // ok
+ {
+ self->m_nulLen = out - m_nulBuf;
+ }
+ }
+
+ *nulLen = m_nulLen;
+ return m_nulBuf;
+}
+