From 183a7b190801a1adcc4c849b7a8a1a4f6d087c56 Mon Sep 17 00:00:00 2001 From: Tr0n Date: Sat, 6 Apr 2024 00:25:51 +0200 Subject: [PATCH] add example to readme and sample file --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ test.cpp | 4 ++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aea18cc..35eade4 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,45 @@ find . -name '*.cpp' -exec iconv -f EUC-KR -t UTF-8//TRANSLIT -o {}_u {} \; -exe Repeat for the desired file extensions. +## Example result + +Original File Content (read as UTF-8) + +```cpp +// this string literal should be converted +chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("�̰� ������ �Ⱦ���")); +// this line should stay untouched +DWORD dwOppList[8]; // �̰� ������ �Ⱦ��� +``` + +Original File Content (read as EUC-KR and converted to UTF-8) + +```cpp +// this string literal should be converted +chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이거 지금은 안쓴데")); +// this line should stay untouched +DWORD dwOppList[8]; // 이거 지금은 안쓴데 +``` + +After running this script (read as UTF-8) + +```cpp +// this string literal should be converted +chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("\xC0\xCC\xB0\xC5 \xC1\xF6\xB1\xDD\xC0\xBA \xBE\xC8\xBE\xB4\xB5\xA5")); +// this line should stay untouched +DWORD dwOppList[8]; // �̰� ������ �Ⱦ��� +``` + +After running `iconv` on the script output (read as UTF-8) + +```cpp +// this string literal should be converted +chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("\xC0\xCC\xB0\xC5 \xC1\xF6\xB1\xDD\xC0\xBA \xBE\xC8\xBE\xB4\xB5\xA5")); +// this line should stay untouched +DWORD dwOppList[8]; // 이거 지금은 안쓴데 + +``` + ## Usage To install dependencies: diff --git a/test.cpp b/test.cpp index 8597d12..e2c7da7 100644 --- a/test.cpp +++ b/test.cpp @@ -1,4 +1,4 @@ // this string literal should be converted -chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("�ִ� ��Ƽ�� 8�� �̹Ƿ�..")); +chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("̰ Ⱦ")); // this line should stay untouched -DWORD dwOppList[8]; // �ִ� ��Ƽ�� 8�� �̹Ƿ�.. +DWORD dwOppList[8]; // ̰ Ⱦ