AdvGDrive UTF8 ERROR and Debug

I'm Korean.. I don't english well.

 

unit CloudBase;

Origin Source ( Fail Red "전화번호" -> "전?번?,"123"  )
function TCloudBase.GetJSONObject(URL: string): TJSONObject;
var
  jv: TJSONValue;
  sl: TStringList;
  st: TMemoryStream;
  sa: ansistring;

begin
  st := TMemoryStream.Create;
  sl := TStringList.Create;
  try
    HttpsGet(URL,st, 0);
    st.Position := 0;

    sl.LoadFromStream(st);
    sa := ansistring(sl.Text);    <-- Korean or another 2Byte Char Error
    jv := TJSONOBject.ParseJSONValue(UTF8ToString(sa)); 

    Result := jv as TJSONObject;
  finally
    sl.Free;
    st.Free;
  end;
end;

Change Source ( Success "전화번호","123" -> "전화번호","123"   )

function TCloudBase.GetJSONObject(URL: string): TJSONObject;
var
  jv: TJSONValue;
  sl: TStringList;
  st: TMemoryStream;
  sa: ansistring;

  stmp : UTF8String;  // New Add
  sTmp2 : AnsiString; // New Add
begin
  st := TMemoryStream.Create;
  sl := TStringList.Create;
  try
    HttpsGet(URL,st, 0);
    st.Position := 0;

    // origin Source
    {
    sl.LoadFromStream(st);
    sa := ansistring(sl.Text);
    jv := TJSONOBject.ParseJSONValue(UTF8ToString(sa));
    }

    // Change Source
    stmp := '';
    SetLength(stmp, st.Size);
    st.ReadBuffer(Pointer(stmp)^, st.Size); // First Get The UTF8String
    sTmp2 := Utf8ToAnsi(stmp); // Next Change To the AnsiString
    jv := TJSONOBject.ParseJSONValue(sTmp2);

    Result := jv as TJSONObject;
  finally
    sl.Free;
    st.Free;
  end;
end;



We have investigated and tested this here but with this code, several things don't work correct anymore.

Could you please provide exact information / test code where you encounter a problem with our implementation, so we can investigate it.