summaryrefslogtreecommitdiff
path: root/libs/filesystem/test/issues/3332/test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/filesystem/test/issues/3332/test.cpp')
-rw-r--r--libs/filesystem/test/issues/3332/test.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/libs/filesystem/test/issues/3332/test.cpp b/libs/filesystem/test/issues/3332/test.cpp
new file mode 100644
index 000000000..9456a7a83
--- /dev/null
+++ b/libs/filesystem/test/issues/3332/test.cpp
@@ -0,0 +1,37 @@
+#include <boost/filesystem.hpp>
+#include <cvt/cp950>
+#include <iostream>
+#include <string>
+#include <locale>
+
+namespace fs = boost::filesystem;
+
+int main(void) {
+
+ std::locale global_loc = std::locale();
+ std::locale loc(global_loc, new stdext::cvt::codecvt_cp950<wchar_t>);
+ fs::path::imbue(loc);
+
+ std::cout <<
+ "HEADS UP! PIPE OUTPUT TO FILE AND INSPECT WITH HEX OR CP950 EDITOR.\n"
+ "WINDOWS COMMAND PROMPT FONTS DON'T SUPPORT CHINESE,\n"
+ "EVEN WITH CODEPAGE SET AND EVEN AS OF WIN 10 TECH PREVIEW." << std::endl;
+
+ fs::recursive_directory_iterator end;
+ fs::recursive_directory_iterator iter
+ ("C:/boost/test-files/utf-8");
+
+ while (iter != end)
+ {
+ if (fs::is_directory(*iter))
+ {
+ std::cout << "[directory] " << iter->path().generic_string() << std::endl;
+ }
+ else if (fs::is_regular(*iter))
+ {
+ std::cout << " [file] " << iter->path().generic_string() << std::endl;
+ }
+ ++iter;
+ }
+ return 0;
+}