summaryrefslogtreecommitdiff
path: root/src/utf8.c
Commit message (Collapse)AuthorAgeFilesLines
* Do not interpret nor emit invalid Unicode encoding formsPierre Le Marre2023-05-131-2/+14
| | | | | | Surrogates are invalid in both UTF-32 and UTF-8. See https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf#G28875 and https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf#G31703
* build: include config.h manuallyRan Benita2019-12-271-0/+2
| | | | | | | | | Previously we included it with an `-include` compiler directive. But that's not portable. And it's better to be explicit anyway. Every .c file should have `include "config.h"` first thing. Signed-off-by: Ran Benita <ran@unusedvar.com>
* keysym-utf: reject out-of-range Unicode codepoints in xkb_keysym_to_utf{8,32}Ran Benita2018-06-231-7/+3
| | | | | | | | | | It used to be UTF-8 was defined for inputs > 0x10FFFF, but nowadays that's the maximum and a codepoint is encoded up to 4 bytes, not 6. Fixes: https://github.com/xkbcommon/libxkbcommon/issues/58 Fixes: https://github.com/xkbcommon/libxkbcommon/issues/59 Reported-by: @andrecbarros Signed-off-by: Ran Benita <ran234@gmail.com>
* Convert http:// -> https:// where possibleRan Benita2017-12-211-1/+1
| | | | Signed-off-by: Ran Benita <ran234@gmail.com>
* Add utf8.{c,h} for common UTF-8 util functionsRan Benita2014-03-221-0/+142
We need to validate some UTF-8, so this adds an is_valid_utf8() function, which is probably pretty slow but should work correctly. Signed-off-by: Ran Benita <ran234@gmail.com>