From 7c34acc2b79b18eab1b19724fc5ad67fd36d7bdd Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 17 May 2016 12:44:43 -0400 Subject: [PATCH] And an itoutf16() too, because why not. Okay, NOW for updating the labels. --- windows/uipriv_windows.hpp | 1 + windows/utf16.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) 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()); +}