This commit is contained in:
flywind 2021-07-13 15:22:33 +08:00 • committed by GitHub
commit 15fdcd0c4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"