Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Set active CP to UTF-8 on Windows 10 and 11 #139

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

########################################################################
Expand Down
23 changes: 23 additions & 0 deletions bin/base64.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity type="win32" name="base64" version="0.5.2.0" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 and Windows 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<application>
<windowsSettings>
<activeCodePage
xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
</windowsSettings>
</application>
</assembly>
2 changes: 2 additions & 0 deletions bin/base64.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "winuser.h"
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "base64.manifest"
2 changes: 2 additions & 0 deletions test/ci/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
😵‍💫.bin binary -text
checksums.txt text eol=lf
1 change: 1 addition & 0 deletions test/ci/checksums.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4cd842ba8dce30216f77d2d5bf8a648e2dba6d95be5b12884f81e55bfab7b3cc *😵‍💫.bin
2 changes: 2 additions & 0 deletions test/ci/😵‍💫.bin
Original file line number Diff line number Diff line change
@@ -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.
😵‍💫
Loading