Lines 1-25
Link Here
|
1 |
--- src/BunnySay.cpp.orig 2016-08-31 12:47:32 UTC |
|
|
2 |
+++ src/BunnySay.cpp |
3 |
@@ -34,8 +34,9 @@ L"/ づ"; |
4 |
// Writes wstring input to the stdout after chunking it and converting |
5 |
// all characters to their wide counterparts in unicode |
6 |
void BunnySay::writeBunnySay(std::wstring input) { |
7 |
+ std::wstring_convert<std::codecvt_utf8<wchar_t>,wchar_t> convert; |
8 |
input = replaceString(input); |
9 |
- std::wcout << bunny; |
10 |
+ std::cout << convert.to_bytes(bunny); |
11 |
bool left = true; |
12 |
std::vector<std::wstring> vs; |
13 |
vs = splitAtWidth(input + L" ", width); |
14 |
@@ -54,9 +55,9 @@ void BunnySay::writeBunnySay(std::wstrin |
15 |
|
16 |
// Add the pipes |
17 |
curstring = L"|" + curstring + L"|\n"; |
18 |
- std::wcout << curstring; |
19 |
+ std::cout << convert.to_bytes(curstring); |
20 |
} |
21 |
- std::wcout << bunny2 << std::endl; |
22 |
+ std::cout << convert.to_bytes(bunny2) << std::endl; |
23 |
} |
24 |
// Helper function to split a sentance delimited with fixed-width spaces |
25 |
// into strings 10 chars or less |