|
Lines 206-213
Link Here
|
| 206 |
void |
206 |
void |
| 207 |
print_string2( FILE *fp, const byte *p, size_t n, int delim, int delim2 ) |
207 |
print_string2( FILE *fp, const byte *p, size_t n, int delim, int delim2 ) |
| 208 |
{ |
208 |
{ |
|
|
209 |
/* From gpg (1) manual page: |
| 210 |
* --with-colons |
| 211 |
* Print key listings delimited by colons. Note that the output will |
| 212 |
* be encoded in UTF-8 regardless of any --display-charset setting. |
| 213 |
* const byte *p - will be point ot utf8 string. |
| 214 |
* |
| 215 |
* Please see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 for additional info |
| 216 |
* Range (*p >= 0x7f && *p < 0xa0) - is not valid for utf8 encoding. Remove them. |
| 217 |
*/ |
| 209 |
for( ; n; n--, p++ ) |
218 |
for( ; n; n--, p++ ) |
| 210 |
if( *p < 0x20 || (*p >= 0x7f && *p < 0xa0) |
219 |
if( *p < 0x20 |
| 211 |
|| *p == delim || *p == delim2 |
220 |
|| *p == delim || *p == delim2 |
| 212 |
|| ((delim || delim2) && *p=='\\')) |
221 |
|| ((delim || delim2) && *p=='\\')) |
| 213 |
{ |
222 |
{ |