diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e1e59247..28d8b66a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -212,6 +212,13 @@ jobs: - name: CTest shell: msys2 {0} run: ctest --no-tests=error --test-dir out -VV --build-config Release + - name: Test demo utility with unicode filenames and file contents on Windows + shell: msys2 {0} + run: | + out/bin/base64 test/ci/😵‍💫.bin > test/ci/😵‍💫.bin.b64 + out/bin/base64 -d test/ci/😵‍💫.bin.b64 > test/ci/😵‍💫.bin + cd test/ci + sha256sum -c checksums.txt msys2-makefile-test: name: msys2-makefile-${{ matrix.msystem }} diff --git a/CMakeLists.txt b/CMakeLists.txt index ff9f6f21..4d154e4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -249,6 +249,10 @@ if (BASE64_BUILD_CLI) set_target_properties(base64-bin PROPERTIES OUTPUT_NAME base64 ) + + if (WIN32) + target_sources(base64-bin PRIVATE bin/base64.rc) + endif () endif() ######################################################################## diff --git a/bin/base64.manifest b/bin/base64.manifest new file mode 100644 index 00000000..2bd35617 --- /dev/null +++ b/bin/base64.manifest @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + UTF-8 + + + diff --git a/bin/base64.rc b/bin/base64.rc new file mode 100644 index 00000000..017cf652 --- /dev/null +++ b/bin/base64.rc @@ -0,0 +1,2 @@ +#include "winuser.h" +CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "base64.manifest" diff --git a/test/ci/.gitattributes b/test/ci/.gitattributes new file mode 100644 index 00000000..0ca047d8 --- /dev/null +++ b/test/ci/.gitattributes @@ -0,0 +1,2 @@ +😵‍💫.bin binary -text +checksums.txt text eol=lf diff --git a/test/ci/checksums.txt b/test/ci/checksums.txt new file mode 100644 index 00000000..03ba10a2 --- /dev/null +++ b/test/ci/checksums.txt @@ -0,0 +1 @@ +4cd842ba8dce30216f77d2d5bf8a648e2dba6d95be5b12884f81e55bfab7b3cc *😵‍💫.bin diff --git "a/test/ci/\360\237\230\265\342\200\215\360\237\222\253.bin" "b/test/ci/\360\237\230\265\342\200\215\360\237\222\253.bin" new file mode 100644 index 00000000..96b4e221 --- /dev/null +++ "b/test/ci/\360\237\230\265\342\200\215\360\237\222\253.bin" @@ -0,0 +1,2 @@ +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +😵‍💫