If used --with-colons option gpg always display keys text fields using utf-8
encoding and don't reacts on --charset option. Also some chars are convert to
\xXX format... so this text is difficult to use.
As I descover in this mode text fields are display by "print_string" function
but not "print_utf8_string". If change this behavior the problem goes.
I add quick-patch for with, but check for number of colons(":") need.
Description
Details
- Version
- 1.4.6
Related Objects
- Mentioned In
- T5626: 'GPGCONF --list-dirs' command option on-screen displayed results show '%3a' unexpected and unneeded characters in each line displaying a C: drive path instead of simpler expected '...:C:\...' sub-strings with only valid ':' ('colon') characters present
- Mentioned Here
- D34: 111_gnupg-1.4.6-with-colons-utf8.patch
Event Timeline
Using utf-8 here is a feature and not a bug.
In aftersigned we might have better used percent style excaping instead of
C-style, but we can't change it. Some escaping is obviously needed.
Why? Why not to use --charset to set encoding? Why escaping is needed if this
mode (with-colons) is not appointed to diplay( isn't it?) but to get keys
information to applications?
Because --with-colons is not for humans. The specification says that the output
is utf-8. Haveing this variable would add an additional burden to each consumer
of --with-colons output to convert it.
Any structured data format needs some kind of quoting to distingusih content
from markup. Think of colons or linefeeds in user names.
Because --with-colons is not for humans.
The specification says that the output is utf-8.
Haveing this variable would add an additional burden
to each consumer of --with-colons output to convert it.
Ok. I see.
Any structured data format needs some kind of quoting to
distingusih content from markup. Think of colons or linefeeds
in user names.
Are hex-codes \x98, x9f, \x92 "special"? Why they must be escaped?
Latin-1 defines those as application specific. Some terminals actually use them
as control characters. Thus when filtering any output to do no harm it is
better to escape them too.
A decoder is required anyway and thusit doesn't matter whether they are escaped
or not. Yes it could be opmitimized, but why make things more complicated for no
good reason.