diff --git a/doc/encoding.md b/doc/encoding.md index bc5c178..4d7ca7b 100644 --- a/doc/encoding.md +++ b/doc/encoding.md @@ -130,8 +130,17 @@ const char* s = "..."; // UTF-8 string StringStream source(s); GenericStringBuffer > target; -Transcoder::Transcode, UTF16<> >(source, target) -const wchar_t* t = target.GetString(); +bool hasError = false; +while (source.Peak() != '\0') + if (!Transcoder::Transcode, UTF16<> >(source, target)) { + hasError = true; + break; + } + +if (!hasError) { + const wchar_t* t = target.GetString(); + // ... +} ~~~~~~~~~~ You may also use `AutoUTF` and the associated streams for setting source/target encoding in runtime.