diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index b22a17db16..4334743bb2 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -1,16 +1,22 @@
set(APP_SOURCES
exiv2.cpp
- exiv2app.hpp
actions.cpp
- actions.hpp
getopt.cpp
- getopt.hpp
app_utils.cpp
- app_utils.hpp
)
add_executable(exiv2 ${APP_SOURCES})
+# Make app use UTF-8 code page in Windows
+if(WIN32)
+ if(MSVC)
+ target_sources(exiv2 PRIVATE utf8.manifest)
+ else()
+ # Must wrap manifest in .rc w/ other toolchains
+ target_sources(exiv2 PRIVATE utf8.rc)
+ endif()
+endif()
+
target_include_directories(exiv2 PRIVATE ${PROJECT_SOURCE_DIR}/src) # To find i18n.hpp
set_target_properties(exiv2 PROPERTIES COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS} XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=Debug] "YES")
diff --git a/app/utf8.manifest b/app/utf8.manifest
new file mode 100644
index 0000000000..f205604931
--- /dev/null
+++ b/app/utf8.manifest
@@ -0,0 +1,8 @@
+
+
+
+
+ UTF-8
+
+
+
\ No newline at end of file
diff --git a/app/utf8.rc b/app/utf8.rc
new file mode 100644
index 0000000000..b4cca2abbe
--- /dev/null
+++ b/app/utf8.rc
@@ -0,0 +1,3 @@
+#include
+
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "utf8.manifest"
diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt
index 6d4430ce84..843f763daa 100644
--- a/samples/CMakeLists.txt
+++ b/samples/CMakeLists.txt
@@ -107,6 +107,15 @@ list(APPEND APPLICATIONS remotetest)
# ******************************************************************************
foreach(application ${APPLICATIONS})
+ # Make app use UTF-8 code page in Windows
+ if(WIN32)
+ if(MSVC)
+ target_sources(${application} PRIVATE ${PROJECT_SOURCE_DIR}/app/utf8.manifest)
+ else()
+ # Must wrap manifest in .rc w/ other toolchains
+ target_sources(${application} PRIVATE ${PROJECT_SOURCE_DIR}/app/utf8.rc)
+ endif()
+ endif()
target_link_libraries(${application} PRIVATE exiv2lib std::filesystem)
if(EXIV2_ENABLE_PNG)
target_link_libraries(${application} PRIVATE ${ZLIB_LIBRARIES})