Merged
Conversation
… libyang maps every Unicode block to Latin-1 Supplement Unicode block, if multiple Unicode blocks are present within a single [ ]. This commit corrects the fault and introduces multiple unit tests related to the correct behavior. On branch unicode_block_bug Changes to be committed: modified: src/ly_common.c modified: tests/utests/types/string.c
michalvasko
approved these changes
Apr 7, 2026
michalvasko
requested changes
Apr 7, 2026
Member
michalvasko
left a comment
There was a problem hiding this comment.
Thanks, just some minor issues.
michalvasko
approved these changes
Apr 7, 2026
Member
|
Please use |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
libyang supports patterns that further restrict a string leaf's set of values. The YANG RFC [1] allows the use of Unicode blocks [2] in patterns (e.g. Basic Latin, Cyrillic). libyang, due to a coding error, interprets every Unicode block pattern as Latin-1 Supplement, if multiple Unicode blocks are present in the same pattern. In the corresponding code, the variable responsible to store the Unicode block information, gets overwritten.
The PR corrects the behavior and provides also unit tests.
Corresponding issue: #2507
[1] https://datatracker.ietf.org/doc/html/rfc6020
[2] https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#dt-ccesblock