Edna

Edna

Error in Elixir when interpreting the Ñ

I am currently working locally with Elixir 1.13.4 and Erlang/OTP 24 and in the project image we use Elixir 1.17, we are having problems in Production when interpreting the ñ, the data arrives fine but when we show it Elixir interprets it as “├▒ ”We are already trying to convert to different systems like ISO-8859-1 and Windows-1252 but in both cases it is not possible to decrypt, although elixir handles the system by default UTF-8, we put it explicitly in the headers, we verify that the server response is the same, but even creating a local variable and assigning it “child” in inspection we see it as “ni├▒o”.
We also tried different ways of handling string and even applying String.valid?(text) returns it as true, we also tried to handle it with the equivalent ASCII code but it didn’t work.

I am thinking that it is a version problem, since on the server the version of Elixir is 1.17 and exactly the same problem happens and trying in another version such as 1.16 the Ñ (in uppercase) returns it as N and the ñ (in lowercase ) returns it to me correctly, but we need it to be interpreted in both upper and lower case.

No matter what we try we always get the same answer.

   texto = "niño"
    IO.inspect(texto)
    char = "\u00F1"
    IO.inspect(char)

iex(1)> "ni├▒o"
iex(1)> "├▒"

Most Liked

dimitarvp

dimitarvp

You’ll have to clarify on the production thing. It does look that your terminal cannot show certain characters. Either a font problem or it’s not setup to show UTF-8 by default.

al2o3cr

al2o3cr

The exact bytes represented by "\u00f1" are 0xC3 0xB1, found via:

Base.encode16("\u00f1")

On code page 850 those bytes are interpreted as:

  • 0xC3
  • 0xB1

Where Next?

Popular in Questions Top

pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
Werner
Hi, I’m using Ubuntu 18.04 and after updating to OTP-24.0 yesterday i have this warning when I run “mix local.hex”: 14:57:30.512 [warn] ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
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
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

Other popular topics Top

JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
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
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
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
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement