Fixed unicode support under windows console
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "drvutil.hpp"
|
||||
#include "sslutil.hpp"
|
||||
#include "readline.hpp"
|
||||
#include "../core/enginewrapper.hpp"
|
||||
|
||||
#include <iostream>
|
||||
@@ -233,8 +234,8 @@ static void console_write(const CodepointString &cps) {
|
||||
if (cps.size() == 0) return;
|
||||
// Convert to wstring.
|
||||
// Any character outside the range 0xFFFF is replaced with a box.
|
||||
std::wstring ws(cps.size());
|
||||
for (int i = 0; i < cps.size(); i++) {
|
||||
std::wstring ws(cps.size(), 0);
|
||||
for (int i = 0; i < int(cps.size()); i++) {
|
||||
char32_t c = cps[i];
|
||||
if ((c >= 0)&&(c <= 0xFFFF)) ws[i] = (wchar_t)c;
|
||||
else ws[i] = 0x2610;
|
||||
|
||||
Reference in New Issue
Block a user