

Die URI.parse Die; Long Live the Zen of Addressable
source link: https://fuzzyblog.io/blog/ruby/2020/05/12/die-uri-parse-die-long-live-the-zen-of-addressable.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Die URI.parse Die; Long Live the Zen of Addressable
May 12, 2020

URI.parse is a Ruby call I've written a thousand plus times. The unfortunate reality of URI.parse is that it doesn't work when there are UTF-8 characters in the url. The work around is the addressable gem. So:
Gemfile
gem "addressable"
Example Usage
require 'addressable/uri'
url = 'http://www.example.com/wp content/uploads/2012/01/München.jpg'
parts = Addressable::URI.parse(url)
Sources
- [Stack Overflow] (https://stackoverflow.com/questions/9082732/how-can-i-extract-a-url-with-non-english-characters-from-a-string)
- Home Page
Shoutout
I can't even think about URL parsing in Ruby / Elixir / JavaScript without mentioning Gamache's FuzzyUrl library. Highly, highly recommenderd.
Posted In: #ruby
Recommend
-
65
Go语言规范中规定了可寻址(addressable)对象的定义,For an operand x of type T, the address operation &x generates a pointer of type *T to x. The operand must be addressable, that is, either a variable, pointer ind
-
23
go addressable
-
56
README.md NOVA: NOn-Volatile memory Accelerated log-structured file system NOVA's goal is to provide a high-performance, full-featured, production-ready file system tailored for byte-addressabl...
-
53
Using AWK and R to parse 25tb How to read this post: I sincerely apologize for how long and rambling the following text is. To speed up skimming of it for those who have better things to do with their time,...
-
15
This document introduces "the big idea" behind Unison and walks through the basics of using the Unison codebase manager to develop and publish your first Unison library. We will introduce bits and pieces of the core Uniso...
-
8
Die Sterne -STELL DIE VERBINDUNG HER-liveLooking for autoplay?Choose whether videos automatically play next.Got it
-
9
May You Live Until You DieConducting an Online Seance for Lord HuronThe pandemic has greatly reduced the opportunity to conduct séances around the world, so you can imagi...
-
4
July 27, 2021 Parse Redis-CLI Connection URI To Use With StackExchange.Redis
-
5
-
3
Live By APIs Die By APIs Mar 8, 2023
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK