Fossil SCM
add mkdir to the unicode-supported functions add chinese-named file and directory in test directory, demonstrating the fix
Commit
c780793749f436abad9753df283d701b1b063873
Parent
d8e1431fc0f3e7a…
2 files changed
+2
-2
+1
+2
-2
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -422,12 +422,12 @@ | ||
| 422 | 422 | file_delete(zName); |
| 423 | 423 | } |
| 424 | 424 | if( rc!=1 ){ |
| 425 | 425 | #if defined(_WIN32) |
| 426 | 426 | int rc; |
| 427 | - char *zMbcs = fossil_utf8_to_mbcs(zName); | |
| 428 | - rc = mkdir(zMbcs); | |
| 427 | + wchar_t *zMbcs = fossil_utf8_to_unicode(zName); | |
| 428 | + rc = _wmkdir(zMbcs); | |
| 429 | 429 | fossil_mbcs_free(zMbcs); |
| 430 | 430 | return rc; |
| 431 | 431 | #else |
| 432 | 432 | return mkdir(zName, 0755); |
| 433 | 433 | #endif |
| 434 | 434 | |
| 435 | 435 | ADDED test/世界/界世.txt |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -422,12 +422,12 @@ | |
| 422 | file_delete(zName); |
| 423 | } |
| 424 | if( rc!=1 ){ |
| 425 | #if defined(_WIN32) |
| 426 | int rc; |
| 427 | char *zMbcs = fossil_utf8_to_mbcs(zName); |
| 428 | rc = mkdir(zMbcs); |
| 429 | fossil_mbcs_free(zMbcs); |
| 430 | return rc; |
| 431 | #else |
| 432 | return mkdir(zName, 0755); |
| 433 | #endif |
| 434 | |
| 435 | DDED test/世界/界世.txt |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -422,12 +422,12 @@ | |
| 422 | file_delete(zName); |
| 423 | } |
| 424 | if( rc!=1 ){ |
| 425 | #if defined(_WIN32) |
| 426 | int rc; |
| 427 | wchar_t *zMbcs = fossil_utf8_to_unicode(zName); |
| 428 | rc = _wmkdir(zMbcs); |
| 429 | fossil_mbcs_free(zMbcs); |
| 430 | return rc; |
| 431 | #else |
| 432 | return mkdir(zName, 0755); |
| 433 | #endif |
| 434 | |
| 435 | DDED test/世界/界世.txt |
+1
| --- a/test/世界/界世.txt | ||
| +++ b/test/世界/界世.txt | ||
| @@ -0,0 +1 @@ | ||
| 1 | +Just some text |
| --- a/test/世界/界世.txt | |
| +++ b/test/世界/界世.txt | |
| @@ -0,0 +1 @@ | |
| --- a/test/世界/界世.txt | |
| +++ b/test/世界/界世.txt | |
| @@ -0,0 +1 @@ | |
| 1 | Just some text |