parent
1b128ac045
commit
15fdcd0c4d
1 changed files with 19 additions and 17 deletions
|
|
@ -12,6 +12,7 @@
|
||||||
##
|
##
|
||||||
## The following example shows how to change character encodings.
|
## The following example shows how to change character encodings.
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
|
when defined(windows):
|
||||||
let
|
let
|
||||||
orig = "öäüß"
|
orig = "öäüß"
|
||||||
# convert `orig` from "UTF-8" to "CP1252"
|
# convert `orig` from "UTF-8" to "CP1252"
|
||||||
|
|
@ -27,6 +28,7 @@ runnableExamples:
|
||||||
## created by `open` with `destEncoding` and `srcEncoding` specified. You can use
|
## created by `open` with `destEncoding` and `srcEncoding` specified. You can use
|
||||||
## `convert` on this object multiple times.
|
## `convert` on this object multiple times.
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
|
when defined(windows):
|
||||||
var fromGB2312 = open("utf-8", "gb2312")
|
var fromGB2312 = open("utf-8", "gb2312")
|
||||||
let first = "\203\173\197\194\163\191\210\187" &
|
let first = "\203\173\197\194\163\191\210\187" &
|
||||||
"\203\242\209\204\211\234\200\206\198\189\201\250"
|
"\203\242\209\204\211\234\200\206\198\189\201\250"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue