Solution to error, invalid character and Chinese garbled code when running vbs script (coding problem)

Time:2021-10-6

There is no problem with the code. Such errors are always reported.

Test code

?
1
msgbox "developpaper"

Very simple code, but if the code is wrong, there are many problems

Chinese garbled code problem

Solution to error, invalid character and Chinese garbled code when running vbs script (coding problem)

Operation diagram

Solution to error, invalid character and Chinese garbled code when running vbs script (coding problem)

Due to the use of utf8 coding, I wrote it in Notepad first

Invalid character

Solution to error, invalid character and Chinese garbled code when running vbs script (coding problem)

—————————
windows script host
—————————
script:   c:\users\administrator\desktop\softjc\1.vbs
that ‘s ok:   one
Character:   one
Error:   Invalid character
code:   800a0408
Source:   Microsoft VBScript compiler error

determine

Operation diagram

Solution to error, invalid character and Chinese garbled code when running vbs script (coding problem)

As long as VBS encoded with utf8 BOM is reporting line 1 and character 1 error

Solution to error, invalid character and Chinese garbled code when running vbs script (coding problem)

Or the above can use ANSI coding

Normal operation after modification

Solution to error, invalid character and Chinese garbled code when running vbs script (coding problem)

Some students asked what this software is. In fact, it is powerful, larger than EDITPLUS, slow to start, but free. It is recommended that you use Notepad + + to write script code. Please indicate the source of the original developeppaper article.

Recommended Today

Swift advanced (XV) extension

The extension in swift is somewhat similar to the category in OC Extension can beenumeration、structural morphology、class、agreementAdd new features□ you can add methods, calculation attributes, subscripts, (convenient) initializers, nested types, protocols, etc What extensions can’t do:□ original functions cannot be overwritten□ you cannot add storage attributes or add attribute observers to existing attributes□ cannot add parent […]