diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index ec5da1db..166fd2db 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -1336,11 +1336,20 @@ FMT_FUNC void report_system_error(int error_code, report_error(format_system_error, error_code, message); } +#ifndef FMT_UNICODE +# define FMT_UNICODE 0 +#endif + FMT_FUNC void vprint(std::FILE* f, string_view format_str, format_args args) { memory_buffer buffer; internal::vformat_to(buffer, format_str, basic_format_args>(args)); +#if FMT_UNICODE + internal::utf8_to_utf16 u16(string_view(buffer.data(), buffer.size())); + std::fputws(u16.c_str(), f); +#else internal::fwrite_fully(buffer.data(), 1, buffer.size(), f); +#endif } FMT_FUNC void vprint(string_view format_str, format_args args) {