Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Jun 12, 2024
1 parent 5cfe472 commit 69cdc10
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions api/builtin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ namespace jule
inline void out(const T &obj) noexcept
{
#ifdef OS_WINDOWS
const std::vector<jule::U16> utf16_str = jule::utf16_from_str(jule::to_str<T>(obj));
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
wprintf((wchar_t*)utf16_str.data());
//WriteConsoleW(handle, utf16_str.data(), utf16_str.size(), nullptr, nullptr);
if (GetConsoleOutputCP() == 65001) {
std::cout << obj;
} else {
const std::vector<jule::U16> utf16_str = jule::utf16_from_str(jule::to_str<T>(obj));
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
WriteConsoleW(handle, utf16_str.data(), utf16_str.size(), nullptr, nullptr);
}
#else
std::cout << obj;
#endif
Expand Down

0 comments on commit 69cdc10

Please sign in to comment.