Fork of "native-ascii-converter" VS Code extension, aims to help Minecraft modpack-makers to deal with unicodes.
- Commands (manual execution):
Convert Native characters to Ascii
- Convert all non-ASCII characters in the active text document with Unicode escapes.Convert Ascii to Native characters
- Convert all Unicode escapes characters in the active text document with native characters.
Caution: The two commands above will neglect the configuration parameter zenscript-unicode-converter.comment-conversion
. So be careful to use theese commands if you like to put both native unicode characters and ascii codes in the same file.
- Options:
- If you activate a ZenScript file, all ascii codes (
"\u4e2d\u6587"
for example) will be converted into native characters ("中文"
for example). - If you save a ZenScript file, all native characters will be converted into ascii codes.
- If configured, native characters in comment lines that start with
//
will not be converted.
- If you activate a ZenScript file, all ascii codes (
This extension contributes the following settings:
zenscript-unicode-converter.letter-case
: Use lower case in Unicode. False for upper case.true
: Lower casefalse
: Upper case
zenscript-unicode-converter.comment-conversion
: Deprecated. Unicode conversion of the comment is carried outtrue
: carried outfalse
: not carried out (default)
zenscript-unicode-converter.auto-conversion-on-save
: Convert automatically when a ZenScript file is savedtrue
: effective (default)false
: ineffective
zenscript-unicode-converter.auto-conversion-on-activate
: Convert automatically when a ZenScript file is activatedtrue
: effective (default)false
: ineffective
zenscript-unicode-converter.use-files.associations
: Use "files.associations" in the settings.json for the automatic conversionstrue
: Use "files.associations" in the settings.jsonfalse
: Not use "files.associations", only files named*.zs
are converted automatically. (default)
If zenscript-unicode-converter.use-files.associations
is true
and the settings.json is set as follows, the file which name matches *.foo
or *.bar
will be converted automatically.
{
"files.associations": {
"*.foo": "zenscript",
"*.bar": "zenscript"
}
}
Caution: considering it is not very possibly fot ZenScript (or ZenCode for CraftTweaker 1.16 or above) to change its file extension name, you may not need to use this configuration and just keep it as default.
In extension.ts
there are a piece of code, written and licensed under WTFPL by @raylras.
It utilized Moo to identify comments.
This contribution is highly appreciated.