-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from epasveer/58-memoryvisualizer-add-utf-816…
…32-encodings-to-the-text-box Add UTF8,16,32 support to the Memory Visualizer.
- Loading branch information
Showing
9 changed files
with
186 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hellounicode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.PHONY: all | ||
all: hellounicode | ||
|
||
hellounicode: hellounicode.cpp | ||
g++ -g -o hellounicode hellounicode.cpp | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f hellounicode hellounicode.o | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <iostream> | ||
#include <stdlib.h> | ||
|
||
int main (int argc, char* argv[]) { | ||
|
||
std::wstring w_redrum = { L"All work and no play makes Jack a dull boy.\n" }; | ||
|
||
std::string u8_redrum = { u8"All work and no play makes Jack a dull boy.\n" }; | ||
|
||
std::u16string u16_redrum = { u"All work and no play makes Jack a dull boy.\n" }; | ||
|
||
std::u32string u32_redrum = { U"All work and no play makes Jack a dull boy.\n" }; | ||
|
||
std::u16string u16_hungry = { u"nǐ chīle ma.\n" }; | ||
|
||
// Do something with the strings so they don't get optimized out. | ||
std::cout << w_redrum.length() << std::endl; | ||
std::cout << u8_redrum.length() << std::endl; | ||
std::cout << u16_redrum.length() << std::endl; | ||
std::cout << u32_redrum.length() << std::endl; | ||
std::cout << u16_hungry.length() << std::endl; | ||
|
||
const wchar_t* w_ptr = w_redrum.data(); | ||
const char* u8_ptr = u8_redrum.data(); | ||
const char16_t* u16_ptr = u16_redrum.data(); | ||
const char32_t* u32_ptr = u32_redrum.data(); | ||
const char16_t* hungry_ptr = u16_hungry.data(); | ||
|
||
return 0; | ||
} | ||
|