Edna

Edna

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)> "├▒"

Showing Posts 1 to 8

NobbZ

NobbZ

Elixir is processing everything correctly it seems, it is your terminal that is messing up your display.

Make sure that your terminal interpretes things as UTF-8, not anything else.

Edna

Edna OP

I’m not really sure if it’s the terminal because the same thing happens in production, but I’m going to try to do something with it.

NobbZ

NobbZ

WDYM “in produvtion”?

Tested how?

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.

Edna

Edna OP

It’s not the terminal either, I already did the test and it shows it as it should be
echo "Español, ñandú, café" Español, ñandú, café

dimitarvp

dimitarvp

Nothing jumps to mind then, sorry. I would double-check the terminal encoding settings and the font. I mean OK, the other characters are rendered fine but the font might still have a few omissions.

NobbZ

NobbZ

Here the terminal and system encoding might be just inline and sync. Can you echo that ñ into xxd or another hex dumper?

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
— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
jaybe78
Hello, I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter). The diffic...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
widianto
I think I’ve found a small improvement I could contribute to <%= web_namespace %>.CoreComponents (installer/templates/phx_web/compo...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
aseigo
ICal is a library for interacting with iCalendar data. It parses iCalendars into typed Elixir structs via ICal.from_ics, and can prepare ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews