瀏覽代碼

* fixed off by one error in fpwidestring.Unicode2AnsiMove, which caused an
extra #0 character to the appended to the result, when converting to UTF-8

git-svn-id: trunk@36498 -

nickysn 8 年之前
父節點
當前提交
ab0b07e7c6
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      rtl/objpas/fpwidestring.pp

+ 1 - 1
rtl/objpas/fpwidestring.pp

@@ -254,7 +254,7 @@ begin
   if (cp=CP_UTF8) then
     begin
       destLen:=UnicodeToUtf8(nil,High(SizeUInt),source,len);
-      SetLength(dest,destLen);
+      SetLength(dest,destLen-1);
       UnicodeToUtf8(@dest[1],destLen,source,len);
       SetCodePage(dest,cp,False);
       exit;