add example to readme and sample file
This commit is contained in:
parent
e8c1c0eb37
commit
183a7b1908
39
README.md
39
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.
|
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("<22>̰<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ⱦ<EFBFBD><C8BE><EFBFBD>"));
|
||||||
|
// this line should stay untouched
|
||||||
|
DWORD dwOppList[8]; // <20>̰<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ⱦ<EFBFBD><C8BE><EFBFBD>
|
||||||
|
```
|
||||||
|
|
||||||
|
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]; // <20>̰<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ⱦ<EFBFBD><C8BE><EFBFBD>
|
||||||
|
```
|
||||||
|
|
||||||
|
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
|
## Usage
|
||||||
|
|
||||||
To install dependencies:
|
To install dependencies:
|
||||||
|
|
4
test.cpp
4
test.cpp
|
@ -1,4 +1,4 @@
|
||||||
// this string literal should be converted
|
// this string literal should be converted
|
||||||
chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<EFBFBD>ִ<EFBFBD> <20><>Ƽ<EFBFBD><C6BC> 8<><38> <20>̹Ƿ<CCB9>.."));
|
chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이거 지금은 안쓴데"));
|
||||||
// this line should stay untouched
|
// this line should stay untouched
|
||||||
DWORD dwOppList[8]; // <EFBFBD>ִ<EFBFBD> <20><>Ƽ<EFBFBD><C6BC> 8<><38> <20>̹Ƿ<CCB9>..
|
DWORD dwOppList[8]; // 이거 지금은 안쓴데
|
||||||
|
|
Loading…
Reference in New Issue