Max
Hi,
i use the following code to generate a csv file. The code itself works. The problem are special chars / umlauts.
-
if i use :utf8 i get the file, but special chars like €, öäü are written like €, ü, …
-
if i don´t use :utf8 it works as long as there are no special chars in a row like €, –, … . Then it breaks with the error
erlang error: :no_translationfile = File.open!(System.tmp_dir()<>"/"<>filename, [:write, :utf8]) users = get_users(conn, params) |> Repo.all |> CSV.encode(separator: ?;) |> Enum.each(&IO.write(file, &1))
Thanks!
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
New
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
NobbZ
When you write using utf8 make sure you use it for reading as well. As you describe it, it seems as if your reader uses latin1 aka iso-8859-1
NobbZ
I just realize that you get data from db, maybe it’s not utf8 in there, elixir will not convert.
voughtdq
Are you using MySQL or MariaDB? They use latin1 as their default apparently.
Max
None of them. Postgres 9.6 on AWS RDS. Default settings.
Max
AWS RDS with postgres 9.6 is set to utf8. Not sure what to change in code.
NobbZ
So what do you use to display the output?
Max
Excel 2016. I know you can set encoding on import. But at the end i need a file which can be opened without doing anything. Our users don´t know how do import a csv in excel.
NobbZ
Then you will have 3 options:
If the customer doesn’t know how to do, it is not your fault. Also it is not your fault, that excel doesn’t use utf8 as default import encoding. Even worse, depending on the system locale, excel may assume different default encodings (thats why I told you to restrict yourself to US-ASCII, which is a subset of all encodings used by MS I already encountered in the wild).
So two things that aren’t even your fault, that you can’t do anything about, but your customer tries to blame you?
Max
Mhm, i know how to generate a csv. But as fas as i know i can´t set encoding in the file(?). I don´t know how to generate a xls file. But thanks for your input and time.
And yes, the customers blame me
We have strange customers.
NobbZ
Maybe you can use
elixlsx?