Decode Unicode escapes in !yt responses. (0.41.1)
Fixed !yt displaying raw JSON Unicode escape sequences (e.g. \u0027 instead of ') in video titles and channel names. YouTube's oEmbed API returns non-ASCII characters as \uXXXX escapes, which were previously passed through as-is to IRC. - Added yt_hex_digit(): converts a hex character to its numeric value (0-15) - Added yt_codepoint_to_utf8(): encodes a Unicode code point as 1-4 UTF-8 bytes, handling the full range from U+0000 through U+10FFFF - Added yt_decode_unicode_escapes(): scans a string for \uXXXX sequences and replaces each with the corresponding UTF-8 bytes in-place. Safe for in-place modification because UTF-8 output is always shorter than the 6-byte escape sequence - Both title and author fields are now decoded after extraction from the JSON response - Added doc comments to all three new helper functions - Updated CHANGELOG.md with 0.41.1 entry documenting all changes
This commit is contained in:
parent
d59d4dc46c
commit
0f0e6a5b1b
3 changed files with 76 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
project(zynk VERSION 0.41.0 LANGUAGES C)
|
||||
project(zynk VERSION 0.41.1 LANGUAGES C)
|
||||
|
||||
# Prefer C99; the code is compatible with C99/C11
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue