ericlathrop
Data_url: Parse data: URLs and access the data contained therein
I needed to parse some data: URLs to get the binary data, and the built-in URI module didn’t do it. So here’s a small library for parsing them. If someone wants to add %DataUrl{} → to_string(), I’d gladly accept it.
From the README:
data_url
Parse data: URLs and access the data contained therein
Usage
iex(1)> DataUrl.parse("data:text/plain;charset=ISO-8859-1;base64,SGVsbG8sIFdvcmxkIQ==")
{:ok,
%DataUrl{data: "Hello, World!", mime_type: "text/plain;charset=ISO-8859-1"}}
Trending in Announcing
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
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
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly.
One of i...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
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
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
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
Other Trending Topics
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
We want to introduce a new native datatype to Erlang: native records. Although replacing all tuple records with native records is not our...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog
It says that Fly is going all-in on sprites, which is a worry ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #performance










First 6 of 6 Posts
kip
ex_url also parses
dataURIs (as well asgeo,tel,mailtoanduuidURIs). It also includes ato_string/1function(I’m the author)
ericlathrop
Cool! I did try searching hex & elsewhere for a library to parse data URLs before making this. I did manage to eventually find
ex_url, but there were a few minor issues I saw with it so I decided to publishdata_urlanyway. Maybe I should just make a PR toex_url.US-ASCIIif the mediatype is omittedURL.parse("data:")explodes, but I would prefer an:errorURL.parse("data:;base64,=")explodes, but I would prefer an:errorkip
Wow, appreciate the bug reports - thank you! I’m on it right away.
Also, hope I didn’t seem like I was hijacking your announcement - great to see new libraries getting built. Well done and much appreciated.
Now back to some bug eradication
kip
On reviewing RFC 6838 it seems like
UTF-8should now be considered the defaultcharsetparameter for amediatype? Your thoughts?From Section 4.2.1:
ericlathrop
I was going mostly off this MDN page, which refers to RFC2397 which says:
kip
Good call. I suspect is a case of RFP’s falling out of sync but I agree,
US-ASCIIit is.