mmmrrr

mmmrrr

UTF-8 Solr answer yields charlist

Currently I have a problem with an answer I’m getting from my Solr server.

When I request it directly from JavaScript or with Postman/Insomnia I get an UTF-8 document that displays my umlauts correctly. E. g. one value contains the german word Tür which will be rendered as is.

When I make the request from Elixir I’ll get a charlist as the documents body. This is then parsed as JSON and theoretically working as expected, except that now the Tür gets rendered as Tür.

What am I doing wrong here? I already tried converting it to string, which only yields a bitstring.

Marked As Solved

joaoevangelista

joaoevangelista

I have checked the Hui library and it defaults to httpc as http client, but since you mentioned HTTPoison I assume you have configured it as the http client, otherwise since httpc is erlang it could be causing the encoding problem, and the behaviour of returning a charlist as the response.

From their documentation you can configure like:

config :hui, :default
      http_client: Hui.Http.Httpoison

Also Liked

mmmrrr

mmmrrr

The problem is indeed httpc. Httpoison had no effect when I first tried it, because the module was missing and it silently failed.

That’s why I assumed a deeper issue… Thanks for the pointer! :sweat_smile:

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement