I'm migrating from Delphi 2007 to Berlin and a code that worked in 2007 does not work in Berlin. I use the following code to generate a PNG from base64 text, but it is returning the error:
no mapping for the unicode character exists in the target multibyte code page
This error occurs on line stream:= TStringStream.Create(EncdDecd.DecodeString(sTemp));
I'd like to know how to do the correct conversion in Berlin. To help follow the low link with PNG in base 64 and the method with excerpt that does the conversion.
procedure TForm1.LoadPng;
var
sTemp: string;
slTemp: TStringList;
stream: TStringStream;
png: TPngObject;
begin
slTemp := TStringList.Create;
slTemp.LoadFromFile('C:\base64.txt');
sTemp:= slTemp.Text;
if sTemp = '' then
Exit;
stream:= TStringStream.Create(EncdDecd.DecodeString(sTemp));
stream.Position:= 0;
png:= TPngObject.Create;
png.Create.LoadFromStream(stream);
Image1.Picture.Assign(png);
end;