Skip to content

Commit

Permalink
Update folding tables to Unicode 15
Browse files Browse the repository at this point in the history
no library changes needed.
  • Loading branch information
rurban committed Sep 16, 2022
1 parent 0b7f74d commit e5f0547
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/safe_str_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extern "C" {
#endif

/* With this UCD version we generated our tables */
#define SAFECLIB_UNICODE_VERSION 14
#define SAFECLIB_UNICODE_VERSION 15

/**
* The shortest string is a null string!!
Expand Down
6 changes: 5 additions & 1 deletion tests/test_towfc_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ int test_towfc_s(void) {

f = fopen(CFOLD, "r");
if (!f) {
char url[256];
printf("downloading %s ...", CFOLD);
fflush(stdout);
if (system("wget https://www.unicode.org/Public/14.0.0/ucd/CaseFolding.txt"))
snprintf(url, 255,
"wget https://www.unicode.org/Public/%d.0.0/ucd/%s",
SAFECLIB_UNICODE_VERSION, CFOLD);
if (system(url))
printf(" done\n");
else {
printf(" failed\n");
Expand Down
6 changes: 5 additions & 1 deletion tests/test_towlower.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ int test_towlower(void) {

f = fopen(CFOLD, "r");
if (!f) {
char url[256];
snprintf(url, 255,
"wget https://www.unicode.org/Public/%d.0.0/ucd/%s",
SAFECLIB_UNICODE_VERSION, CFOLD);
printf("downloading %s ...", CFOLD);
fflush(stdout);
if (system("wget https://www.unicode.org/Public/14.0.0/ucd/CaseFolding.txt"))
if (system(url))
printf(" done\n");
else {
printf(" failed\n");
Expand Down
9 changes: 4 additions & 5 deletions tests/test_towupper.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,8 @@ int test_towupper(void) {
if (!f) {
char url[256];
snprintf(url, 255,
"wget https://www.unicode.org/Public/%d.0.0/ucd/extracted/"
"DerivedGeneralCategory.txt",
SAFECLIB_UNICODE_VERSION);
"wget https://www.unicode.org/Public/%d.0.0/ucd/extracted/%s",
SAFECLIB_UNICODE_VERSION, GENCAT);
printf("downloading %s via %s ...", GENCAT, url);
fflush(stdout);
if (system(url))
Expand All @@ -174,8 +173,8 @@ int test_towupper(void) {
if (!cf) {
char url[256];
snprintf(url, 255,
"wget https://www.unicode.org/Public/%d.0.0/ucd/CaseFolding.txt",
SAFECLIB_UNICODE_VERSION);
"wget https://www.unicode.org/Public/%d.0.0/ucd/%s",
SAFECLIB_UNICODE_VERSION, CFOLD);
printf("downloading %s via %s ...", CFOLD, url);
fflush(stdout);
if (system(url))
Expand Down

0 comments on commit e5f0547

Please sign in to comment.