joao2391
How to keep a special character?
Hello guys!
I’m using HTTPoison.post!() and I have this JSON as response from an API:
{
"erro": false,
"mensagem": "DADOS ENCONTRADOS COM SUCESSO.",
"total": 1,
"dados": [
{
"logradouroDNEC": "lado \\u00edmpar",
"cep": "123456789",
}
]
}
I would like to keep the special character in “lado \u00edmpar” (lado ímpar)
How can I achieve it?
Marked As Solved
massimo
json = """
{
"error": false,
"mensagem": "DADOS ENCONTRADOS COM SUCESSO.",
"total": 1,
"dados": [
{
"logradouroDNEC": "lado \\u00edmpar",
"cep": "123456789"
}
]
}
"""
Jason.decode!(json)
outputs
%{
"dados" => [%{"cep" => "123456789", "logradouroDNEC" => "lado ímpar"}],
"error" => false,
"mensagem" => "DADOS ENCONTRADOS COM SUCESSO.",
"total" => 1
}
1
Also Liked
joao2391
Thank you massimo!
I’ll try it.
1
Popular in Questions
Hello, I get Persian date from my client and convert it to normal calendar like this:
def jalali_string_to_miladi_english_number(persi...
New
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
Hello,
I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these
buyer = %{
id: ...
New
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
I tried installing
elixir 1.11.2
erlang 23.3.4
via asdf in my zsh shell. Enabled the versions locally and globally.
When I list them ...
New
Hello everybody,
usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Hi guys, i’m new in the Elixir world, and i have to say, that i love it!
i’m having some problem to understand anonymous functions with ...
New
I will often find my self writing things similar to:
case some_value do
nil -> something()
"" -> something()
_ -> someth...
New
Other popular topics
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service.
Currently when I de...
New
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
can someone please explain to me how Enum.reduce works with maps
New
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
Hello everybody,
usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
I will often find my self writing things similar to:
case some_value do
nil -> something()
"" -> something()
_ -> someth...
New







