PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 25 → Problemas com acentuação como resolver
Problemas com acentuação como resolver
Iniciado por Boller, mar., 28 2024 12:02 AM - Sem resposta
Membro registado
3.659 mensagems
Popularité : +175 (223 votes)
Publicado em março, 28 2024 - 12:02 AM
Segue detalhes abaixo

Vc tem que saber o tipo que vc está recebendo

Tem 4 tipos
UTF8
Unicode
Ansi
Html

Sendo eles:

StringToUtf8
https://doc.windev.com/en-US/…

Utf8ToString
https://doc.windev.com/en-US/…

Utf8ToAnsi
https://doc.windev.com/en-US/…

Utf8ToUnicode
https://doc.windev.com/en-US/…

AnsiToUnicode
https://doc.windev.com/en-US/…

UnicodeToAnsi
https://doc.windev.com/en-US/…

AnsiToOem
https://doc.windev.com/en-US/…

OemToAnsi
https://doc.windev.com/en-US/…

Utf8valid
https://doc.windev.com/en-US/…

UtfConvert
https://doc.windev.com/en-US/…

Outros comandos String
https://doc.windev.com/en-US/…

Outras informações
https://doc.windev.com/en-US/…

Tabela AscII
https://www.ascii-code.com/pt


Com o utfcovert e utf8valid que tem na versão 29/2024 pode identificar o tipo e aplicar um switch case de conversão e aplicar uma dessas funções

Lembrando que tem o
UTF8, UTF16 e UTF32


Exemplo

IF UTF8Valid(sUTF8) THEN
// Yes => Convert to UNICODE
sUNICODE is UNICODE string = UTF8ToString(sUTF8)
...
END


https://doc.windev.com/en-US/…


PARA RESOLVER PROBLEMAS DE ACENTUAÇÃO

Prezados,

Caso de problema com acentuação, use:

retorno is string = UFT8toString(textocomacento)

USE O COMANDO UTF8ToString OU AnsiToUnicode


Procedure WS_Android_IOS_HTTPGetResult()

// Variable
bufResHTTP is Buffer
sHTTPResult is string

// Retrieves the result of the query

bufResHTTP=HTTPGetResult(httpResult)

// Result in UTF8 em iOS Apple

If IniOSMode() =True OR IniOSSimulatorMode() =True OR IniOSEmulatorMode() =True

IF StringCount(bufResHTTP, “ISO-8859-1”,IgnoreCase) =0

sHTTPResult=UTF8ToString(bufResHTTP)

ELSE

sHTTPResult=AnsiToUnicode(bufResHTTP)

END

ELSE IF inAndroidMode() =True OR InAndroidSimulatorMode() =True OR InAndroidEmulatorMode() =True

// Result in Android

sHTTPResult=bufResHTTP

END

RESULT sHTTPResult



Busca fonética
https://doc.windev.com/en-US/…

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/