diff --git a/windows/uipriv_windows.hpp b/windows/uipriv_windows.hpp index 7c43874b..d0b84a8c 100644 --- a/windows/uipriv_windows.hpp +++ b/windows/uipriv_windows.hpp @@ -38,6 +38,7 @@ extern WCHAR *vstrf(const WCHAR *format, va_list ap); extern char *LFtoCRLF(const char *lfonly); extern void CRLFtoLF(const char *s); extern WCHAR *ftoutf16(double d); +extern WCHAR *itoutf16(intmax_t i); // debug.cpp // see http://stackoverflow.com/questions/14421656/is-there-widely-available-wide-character-variant-of-file diff --git a/windows/utf16.cpp b/windows/utf16.cpp index 07fd4363..9acc5e82 100644 --- a/windows/utf16.cpp +++ b/windows/utf16.cpp @@ -140,3 +140,14 @@ WCHAR *ftoutf16(double d) s = ss.str(); // to be safe return utf16dup(s.c_str()); } + +// to complement the above +WCHAR *itoutf16(intmax_t i) +{ + std::wostringstream ss; + std::wstring s; + + ss << i; + s = ss.str(); // to be safe + return utf16dup(s.c_str()); +}