Ver Mensaje Individual
  #3  
Antiguo 25-03-2010
Avatar de Softweb
Softweb Softweb is offline
Miembro
 
Registrado: ago 2008
Posts: 46
Reputación: 0
Softweb Va por buen camino
Cita:
Empezado por yapt Ver Mensaje
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
Responder Con Cita