-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix non-ascii characters handling in to_hex and to_base64 functions
to_hex and to_base64 functions were expecting `string` as an input type, which caused the value to be CastFn'ed to string, which in turn resulted in raw bytes being cast to []rune (in makeDecodeValueOut). This operation replaces invalid UTF-8 bytes with 0xFFFD, which then were passed on to the hex/base64 encoders, resulting in incorrect output. This patch fixes it by expecting `any` as an input type, which allows the function to correctly read raw bytes of the input data.
- Loading branch information
Showing
4 changed files
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
$ fq '.uncompressed | to_base64' random.bin.gz -r | ||
8Vr6cUH6erA= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
$ fq '.uncompressed | tohex' random.bin.gz -r | ||
f15afa7141fa7ab0 |