8
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JScript(Windows スクリプト ファイル)をUTF-8で書く

Last updated at Posted at 2014-05-03

エンコード指定すれば問題なく実行できます。

test.wsf
<?xml version="1.0" encoding="utf-8" ?>
<package>
	<job>
	<?job error="True" debug="True" ?>
		<runtime/>
		<script language="JScript">
			<![CDATA[
			WScript.Echo("ほげ");
			]]>
		</script>
	</job>
</package>

ただし、ファイルを分割してインクルードすると文字コードのエンコードが上手く認識されないので、インクルードするファイルには BOM を付けて下さい。

test.wsf
<?xml version="1.0" encoding="utf-8" ?>
<package>
	<job>
	<?job error="True" debug="True" ?>
		<runtime/>
		<script language="JScript" src="./test.js"/>
		<script language="JScript">
			<![CDATA[
			main();
			]]>
		</script>
	</job>
</package>
test.js
function main()
{
	WScript.Echo("ほげ");
}
8
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?