Important!

Blog moved to https://blog.apdu.fr/

I moved my blog from https://ludovicrousseau.blogspot.com/ to https://blog.apdu.fr/ . Why? I wanted to move away from Blogger (owne...

Thursday, May 28, 2020

Unicode characters in a reader name

It is now possible to use Unicode characters in a reader name.

History

Since the beginning of pcsc-lite (at least since the first version of pcsc-lite in 2002 that is in a Version Control System) only a subset of ASCII was considered as legal characters for a PC/SC reader name.

In 2011 I added the character ";" in the list so that it is possible to use the "&" sign (encoded as "&" since the reader list is encoded as XML in the Info.plist file). This was to support a reader name like "Giesecke & Devrient".

In 2012 I added the characters "[" and "]".

In 2020 I add support of any Unicode character.

This request came from the use of the reader name "SoloKeys Solo ๐Ÿ". See the Salsa ticket "Unicode in USB Product string not supported." for more details.

Demo

First example

± pcsc_scan 
Using reader plug'n play mechanism
Scanning present readers...
0: ู…ุฑุญุจุง ุจุงู„ุนุงู„ู… ๐Ÿ˜€ ๐ŸŽ‚ 00 00
1: ืฉืœื•ื ืขื•ืœื ๐Ÿ˜Ž ๐Ÿ˜ผ 01 00

Sat May 16 10:52:58 2020
Reader 0: ู…ุฑุญุจุง ุจุงู„ุนุงู„ู… ๐Ÿ˜€ ๐ŸŽ‚ 00 00
Event number: 1
Card state: Card removed,
Reader 1: ืฉืœื•ื ืขื•ืœื ๐Ÿ˜Ž ๐Ÿ˜ผ 01 00
Event number: 0
Card state: Card inserted,
ATR: 3B BE 96 00 00 41 03 00 00 00 00 00 00 00 00 00 02 90 00
In case you do not have the correct font installed in your web browser here is a picture version of the same output.

You can note that the reader names are reversed between the text version and the image version. I let you find what is the "problem" here.

Second example

± pcsc_scan 
Using reader plug'n play mechanism
Scanning present readers...
0: ๐Ÿ˜บ ๐Ÿ˜ธ ๐Ÿ˜น ๐Ÿ˜ป ๐Ÿ˜ผ ๐Ÿ˜ฝ ๐Ÿ™€ ๐Ÿ˜ฟ ๐Ÿ˜พ 00 00
1: ๐Ÿ’‹๐Ÿ’˜๐Ÿ’๐Ÿ’–๐Ÿ’—๐Ÿ’“๐Ÿ’ž๐Ÿ’•๐Ÿ’Ÿ๐Ÿ’”๐Ÿงก๐Ÿ’›๐Ÿ’š๐Ÿ’™๐Ÿ’œ๐Ÿ–ค 01 00
 
Sat May 16 11:17:00 2020
 Reader 0: ๐Ÿ˜บ ๐Ÿ˜ธ ๐Ÿ˜น ๐Ÿ˜ป ๐Ÿ˜ผ ๐Ÿ˜ฝ ๐Ÿ™€ ๐Ÿ˜ฟ ๐Ÿ˜พ 00 00
  Event number: 0
  Card state: Card removed, 
 Reader 1: ๐Ÿ’‹๐Ÿ’˜๐Ÿ’๐Ÿ’–๐Ÿ’—๐Ÿ’“๐Ÿ’ž๐Ÿ’•๐Ÿ’Ÿ๐Ÿ’”๐Ÿงก๐Ÿ’›๐Ÿ’š๐Ÿ’™๐Ÿ’œ๐Ÿ–ค 01 00
  Event number: 0
  Card state: Card inserted, 
  ATR: 3B BE 96 00 00 41 03 00 00 00 00 00 00 00 00 00 02 90 00
Again with the screen capture:

Of course you have no obligation to use some many funny Unicode characters in your reader name. It was just an example.

Availability

You need to use CCID version 1.4.33 or more and pcsc-lite version 1.9.0 or more.

These versions are not yet available (when I write this article) so I prepared snapshot of both software at http://ludovic.rousseau.free.fr/softwares/pcsc-lite/. They are pcsc-lite-1.8.26-047789c.tar.bz2 and ccid-1.4.32-e782d48.tar.bz2.

You can also use the current git version of pcsc-lite and ccid if you know what you do.

Linux

I made the development and tests on a Debian GNU/Linux system.

macOS

I also tested the new CCID driver on macOS Mojave and it works fine with Unicode characters. I found no issue.

Conclusion

I do not expect to see many smart card readers with emoticons, but maybe names with characters from non-Latin alphabets.