Skip to content

Unicode block bug#2508

Merged
michalvasko merged 5 commits intoCESNET:develfrom
nokia:unicode_block_bug
Apr 7, 2026
Merged

Unicode block bug#2508
michalvasko merged 5 commits intoCESNET:develfrom
nokia:unicode_block_bug

Conversation

@manoe
Copy link
Copy Markdown

@manoe manoe commented Apr 7, 2026

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

manoe added 2 commits April 2, 2026 09:18
… 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
Copy link
Copy Markdown
Member

@michalvasko michalvasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just some minor issues.

@manoe manoe requested a review from michalvasko April 7, 2026 12:11
@michalvasko
Copy link
Copy Markdown
Member

Please use uncrustify to correct the indentation and fix the tests. If you are really unable to, I can run it for you and them merge the changes manually.

@michalvasko michalvasko merged commit 0f6c94b into CESNET:devel Apr 7, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants