Cita:
Empezado por yapt
Seguro que ya has probado esto, pero en Delphi 2010, a mí me funciona bien.
Código Delphi [-]var a : AnsiString; s : WideString; begin s := 'Avión'; a := AnsiString(s); end;
De hecho también funcionaría así:
Código Delphi [-] s := 'Avión'; a := s;
No sé... si tienes alguna pista más....
Saludos.
|
Gracias
yapt por responder, ya lo e solucionado gracias a una pista sobre la función MultiByteToWideChar, e creado una función para la conversión.
Código Delphi
[-]
function UTF8ToWideString(const S: AnsiString): WideString;
var
BufSize: Integer;
begin
Result := '';
if Length(S) = 0 then Exit;
BufSize := MultiByteToWideChar(CP_UTF8, 0, PAnsiChar(S), Length(S), nil, 0);
SetLength(result, BufSize);
MultiByteToWideChar(CP_UTF8, 0, PANsiChar(S), Length(S), PWideChar(Result), BufSize);
end;
Saludos y gracias por responder