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

chokchit
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
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
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
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
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
aalberti333
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
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
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

Other popular topics Top

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
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
pmjoe
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
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43806 214
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127536 1222
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement