56 comments

[ 3.0 ms ] story [ 107 ms ] thread
Is there a command line tool to generate QR codes out there?
Also https://github.com/gtanner/qrcode-terminal (nodejs) Generates code with ascii block characters. Can be use as a library or a a terminal command
Both libqrencode and qrcode-terminal are capable of using ANSI escape codes for colored text to produce black and whites squares. Two space characters make about the right aspect ratio in an xterm window. I reinvented the same method myself a while ago, so it's funny how different people come up with the same idea. Haven't tried it on a VT100 terminal yet, but it should probably work there too.
Specifically for text QR, there's `qr` from:

https://github.com/lincolnloop/python-qrcode

In Archlinux, it's in the python-qrcode package.

There're other command line utilities to make PNG QRs, like `qrencode`.

qrencode also has a -t argument which accepts a utf8 value. Great way for quickly opening URLs you have in your clipboard on mobile devices during development as you can pipe in your clipboard to qrencode.
I think that's kinda the same as what expo-cli is using to display a QR code on a terminal. Right?
I love this. I can't get the newline breaks to work in my QR scanner, but I got excited about the idea of generating recursive QR codes. i.e. QR codes that embed another unicode QR code inside of them.
If the author already knows this is not ASCII, maybe don't name it ASCII QR?
SEO? Many people still call ANSI and Unicode art "ASCII art".
This is exactly it.

It would be like if I made a website called "veggiebot" and the logo were a tomato, and everyone were getting up in arms about tomatoes technically being a fruit (berry).

Yes. In theory tomatoes are not vegetables. But in practice they are treated as vegetables and searching for images of "vegetables" in google will almost certainly yield pictures of tomatoes.

In theory ASCII is not Unicode. But in practice, 99% of people don't care about the under-the-hood esoteric intricacies of all the different character encodings. They see a picture made from printable characters instead of pixels and think "ASCII art"

I agree with you! But while we're being pedantic, I should complain that I don't like "tomato/fruit" analogy since the categories "fruits" and "vegetables" are not mutually exclusive.

There's no botanical definition of "vegetable" like there is with "fruit". So it's sort of disingenuous to complain about edible plant categorization while using the social/cultural sense of the first word but not the other.

> In theory tomatoes are not vegetables.

I don't think I agree with that sentence. "Did you know that a tomato is technically a fruit?" is true and interesting if you've never heard it before.

On the other hand "Did you know that a tomato isn't a vegetable; it's technically a fruit!" <- This is false. Fruits are only not vegetables if you use the social/cultural sense of both words.

I was struggling with coming up with a perfect analogy, but this phenomenon basically happens when a word becomes ubiquitous to mean an entire class of something, like how "Kleenix" means "tissue" or "Coke" means "carbonated beverage" (depending on your location in the US).

Author: "Coke QR"

HN: "That's not Coke, that's Sprite!"

dang: changes title to "Carbonated Beverage QR"

I feel like the word "crypto" is similarly being pushed away from its original meaning.
The US Supreme Court ruled that tomatoes are considered vegetables for tax purposes under the Tariff of 1883 in Nix v Hedden.
So now there's a legal definition of one of those words to confuse the issue even further! :)
(1) I acknowledge that the author already states that "[they are] quite well aware that this uses Unicode not ASCII."

(2) Having said that, as a request to everybody for future text-based creations, could we please stop referring to non-ASCII text as "ASCII". Using characters that aren't in ASCII really shouldn't be referred to as ASCII. Pretty please.

(3) The more generic label of "text QR" or "text-based QR" would be better, in my opinion. In this particular situation, saying "Unicode text QR" or "Unicode QR" would also be appropriate.

i wonder why they call for Unicode usage when the extended ascii 219 - 223 could do the same

e: lol why downvoting the inquisitive reader? this community sheeesh. hacker news seems a misnomer more than anything.

Depending on the codepage ... extended ASCII is just as much a misnomer here as ASCII in the original post.
Okay how about codepage 437 then
Because ASCII is an American-centric standard that needs to die, in favor of more inclusive standards?

Unicode is already not common enough, last thing that IMHO is needed are _more_ programs that don't implement well accepted, well tested standards.

It seems like "ASCII QR" is a play on "ASCII art", which is an existing compound word with a specific history and meaning that the term "text art" simply does not have. When I think of ASCII art, it reminds me of old plain-text video game FAQs, which often included elaborate ASCII art throughout. "Text QR" or "Unicode QR" does not have that association.
Of course; but ASCII art only uses ASCII characters. Back in the BBS days you could use ANSI to give you different characters and colors; but that was called ANSI, not ASCII.

"Unicode QR" is probably the best term for what's happening here.

And "ANSI" is also a misnomer.

It's typically used to refer to certain Microsoft 8-bit code pages, like Windows-1252, that extend 7-bit ASCII to 8 bits. My understanding is that these code pages were proposed as an ANSI standard, but never adopted. ISO 8859-1 (Latin-1) is similar but not identical to Windows-1252 (Latin-1 has control characters in some positions where Windows-1252 has printable characters -- and Unicode inherits those control characters from Latin-1.)

The meaning of words change. Selfie used to mean a self-taken photo of yourself. Now people call every photo of a person a selfie.

ASCII used to mean a specific encoding, but its most widely known usage was in ASCII Art. And so the meaning of the word changes: ASCII starts to mean “ASCII art” even when it’s Unicode.

You can't fight semantics. Words take on new meanings all the time. "Literally" and "nonplussed" used to mean one thing, now they mean the opposite thing.

"ASCII" is becoming ubiquitous for "Of or relating to printing characters in the style of a terminal shell/CLI"

Just look at the package that was the #1 link yesterday - Asciinema or whatever.

I bet you a dollar Asciinema isn't actually printing ASCII encoded characters.

Ok, we'll change the title above to Text QR.

Please let's discuss something more interesting than the name now.

Just replace black boxes with '#' and voila you have real ASCII.
It's not that simple. You have also half blocks (U+2580 UPPER HALF BLOCK, U+2584 LOWER HALF BLOCK) to deal with.
Full: # @ % O Z

Upper half: * ' " ` ^

Lower half: o _ z

Source: have played nethack.

My phone correctly read the code from my laptop screen as-is. I don't think it would with actual low-byte characters.
It probably would if you use the “unreadable” xterm font haha.
Why? I've had my phone read QR codes made of entirely the '#' character, albeit with a small fixed-width font.
I prefer "Oh By"[1] codes which are actually ascii and easier to remember, pass around, and chalk up on walls/trails/streets/signs ...

[1] 0x.co

Am I missing something? 0x.co looks basically like a simple bit.ly clone but that accepts non-urls too.

You need to be online to perform a lookup, and can only look it up on 0x.co. If the website goes down, if the database gets lost, if you don't also include a "go look this up on 0x.co" note, etc. etc. the codes have no utility. These are problems that QR codes solve.

"These are problems that QR codes solve."

Agreed. In fact, I don't know what people use Oh By codes for ... but they do, in fact, create them and even purchase them.

I will point out that it is difficult to "tell" someone a QR code over the phone ... or shout it to them ... or chalk one of them up on a wall, etc. Oh By codes solve this problem (to whatever degree this is a problem to someone).

That's just a service for hosting up to four kilobytes of text combined with an URL shortener.

If the service provider ever decides to discontinue it, and they eventually will, all your codes will become meaningless. As are they when you don't have internet access for whatever reason.

QR on the other hand can embed a similar amount of text and is always readable and independent of any single service provider.

"If the service provider ever decides to discontinue it, and they eventually will, all your codes will become meaningless."

Oh By will continue to be maintained into the indefinite future. Come see in twenty years.

I have a very good track record in this regard.

Sure, but what happens when you are no longer? Have you set up a foundation to run it?
> *I am quite well aware that this uses Unicode not ASCII...

interesting naming choices you made there

Your take on the future of QR codes? (Other than payments in Asia)
Not op but I think QR codes are great and here to stay. They might not be the most efficient or ideal on a technical level, but they are very intuitive with basically universal mindshare. People understand the concept of scanning barcodes.
Ever since Apple added automatic detection of QR codes to the camera app, I think they're pretty well cemented as a good way to transmit small amounts of data.
Super convenient for getting guests connected to the Wifi; I have a shell alias that runs:

    qrencode -t utf8  "WIFI:T:WPA2;S:<GuestVLAN-SSID>;P:<SecurePassw0rd>;;"
I know this is beating a dead horse but: https://picturesofpeoplescanningqrcodes.tumblr.com

I don't think I've honestly ever seen someone use QR codes due to their own initiative. I.e, I've seen people use it to pair stuff (≈ Apple watch) and for 2FA etc.

But I think the whole concept of QR codes on posters etc will never take off. It's probably quicker to type in a URL or search for it, the codes are also often time to small or cumbersome to actually scan successfully.

I think the idea of augmenting meatspace content with some kind of hyperlink will finally be implemented on phones with NFC tags, especially since iPhones are starting to support background scanning.

However, when/if AR glasses become mainstream, we will probably use visual markers, and perhaps they will be QR but I'm betting a more visual pleasing standard will come, that can be embedded in the physical space without being as jarring [0].

[0]: Consider the impressive tracking already implemented in ARKit 2 (https://www.youtube.com/watch?v=ZhHExAxyVow). The image is however only recognised as being part of a pre-defined, hardcoded, set of images, but it's not hard to imagine Apple suggesting some "iQR"-standard which is less intrusive but much much much more computationally expensive to detect. I have implemented a silly POC conference app which recognises badges using ARKit 2 simply by using different enough images as background on the badges (wouldn't probably scale to a large conference however...).

you can put a hex encrypted bitcoin key and make a qr code of it like this and paste it everywhere as an alternative to cloud hosting. very nice
Expo does this in its CLI. Pretty handy if you need to connect a mobile device with a dev server or such.
iOS built in QR code reader doesn't recognize it...