diff options
author | bptato <nincsnevem662@gmail.com> | 2021-02-02 21:14:46 +0000 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2021-02-02 21:14:46 +0000 |
commit | e4570e8b6e17382e1cc4984684f861524d5b02f4 (patch) | |
tree | 37b0dc1979c6f020f0c2095891a2bba796b306b0 /mimehead.c | |
parent | Avoid having external programs download images (diff) | |
download | w3m-e4570e8b6e17382e1cc4984684f861524d5b02f4.tar.gz w3m-e4570e8b6e17382e1cc4984684f861524d5b02f4.zip |
Support iTerm2 graphics protocol, replace encodeB with base64_encode
Diffstat (limited to 'mimehead.c')
-rw-r--r-- | mimehead.c | 48 |
1 files changed, 0 insertions, 48 deletions
@@ -350,51 +350,3 @@ decodeMIME0(Str orgstr) return cnv; } -/* encoding */ - -static char Base64Table[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - -Str -encodeB(char *a) -{ - unsigned char d[3]; - unsigned char c1, c2, c3, c4; - int i, n_pad; - Str w = Strnew(); - - while (1) { - if (*a == '\0') - break; - n_pad = 0; - d[1] = d[2] = 0; - for (i = 0; i < 3; i++) { - d[i] = a[i]; - if (a[i] == '\0') { - n_pad = 3 - i; - break; - } - } - c1 = d[0] >> 2; - c2 = (((d[0] << 4) | (d[1] >> 4)) & 0x3f); - if (n_pad == 2) { - c3 = c4 = 64; - } - else if (n_pad == 1) { - c3 = ((d[1] << 2) & 0x3f); - c4 = 64; - } - else { - c3 = (((d[1] << 2) | (d[2] >> 6)) & 0x3f); - c4 = (d[2] & 0x3f); - } - Strcat_char(w, Base64Table[c1]); - Strcat_char(w, Base64Table[c2]); - Strcat_char(w, Base64Table[c3]); - Strcat_char(w, Base64Table[c4]); - if (n_pad) - break; - a += 3; - } - return w; -} |