Commit 5eb32df
authored
Fix URL encoding for non-ASCII bytes (#738)
## Summary
- Treat URL encoder input bytes as unsigned before splitting them into
hex nibbles.
- Add UTF-8 regression coverage for `café` encoding to `caf%C3%A9`.
## Why
On platforms where `char` is signed, bytes >= 0x80 can become negative
before the hex lookup. That can lead to undefined behavior or incorrect
percent encoding for non-ASCII strings.
## Testing
- `cmake -S . -B build -G Ninja -DICEBERG_BUILD_BUNDLE=OFF
-DICEBERG_BUILD_REST=OFF -DICEBERG_BUILD_HIVE=OFF
-DICEBERG_BUILD_SQL_CATALOG=OFF`
- `cmake --build build --target util_test`
- `ctest --test-dir build -R util_test --output-on-failure`1 parent a68602c commit 5eb32df
2 files changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
54 | | - | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
0 commit comments