727
728
729
730
731
732
733
734
735
736
737
738
739
740
|
*/
void canonical16(char *z, int n){
while( *z && n-- ){
*z = zEncode[zDecode[(*z)&0x7f]&0x1f];
z++;
}
}
/*
** Decode a string encoded using "quoted-printable".
**
** (1) "=" followed by two hex digits becomes a single
** byte specified by the two digits
**
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
|
*/
void canonical16(char *z, int n){
while( *z && n-- ){
*z = zEncode[zDecode[(*z)&0x7f]&0x1f];
z++;
}
}
/*
** Decode hexadecimal into a string and return the new string. Space to
** hold the string is obtained from fossil_malloc() and should be released
** by the caller.
**
** If the input is not hex, return NULL.
*/
char *decode16_dup(const char *zIn){
int nIn = (int)strlen(zIn);
char *zOut;
if( !validate16(zIn, nIn) ) return 0;
zOut = fossil_malloc(nIn/2+1);
decode16((const u8*)zIn, (u8*)zOut, nIn);
zOut[nIn/2] = 0;
return zOut;
}
/*
** Decode a string encoded using "quoted-printable".
**
** (1) "=" followed by two hex digits becomes a single
** byte specified by the two digits
**
|