Skip to content

No mapping for the Unicode character exists in the target multi byte code page

Mobius One edited this page Sep 19, 2022 · 3 revisions

Home > Problemas Resolvidos > No mapping for the Unicode character

Problema

No mapping for the Unicode character exists in the target multi-byte code page

Solução

Famoso erro dos Delphis novos referentes a acentuação de strings. As formas existentes para resolver o problema são:

Solução 1:

Utilizar escape_chars(string) no servidor antes de devolver o Result pro cliente e, no cliente, utilizar unescape_chars(string) pra decodificar o texto.

Solução 2:

Ao usar seu JSONObject, JSONArray ou JSONValue, capturar o texto dele como .ToJSON no servidor e no cliente e não como .ToString.

Solução 3:

Converter o texto pra UTF8 com o TEncoding.UTF8 no servidor e no cliente usar UTF8Decode(string).

Clone this wiki locally