# File names with Japanese characters in batch script not working

**URL:** <https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192>\
**Category:** Help & Support\
**Tags:** commands\
**Created:** [November 19, 2020, 4:25pm UTC](https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192 "2020-11-19T16:25:03Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon30529981](https://resource.dopus.com/letter_avatar_proxy/v4/letter/a/bcef8e/32.png) [@anon30529981](https://resource.dopus.com/u/anon30529981)\
**Post date:** [November 19, 2020, 4:25pm UTC](https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192/1 "2020-11-19T16:25:03Z")

</div>

Hey there.

I seem to be having some problems with making a button for Dopus.

What I want to do is to run FFMpeg for the selected files in the lister. But it seems that Dopus does not like Japanese characters.

 ![2020.11.19-17.20.49](https://resource.dopus.com/uploads/default/original/3X/6/b/6ba29e752ad8aece9c3998ac380db7dd44ff3cd2.png)

Is there any way around this? These commands work fine in a regular command prompt window.

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [November 19, 2020, 5:08pm UTC](https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192/2 "2020-11-19T17:08:57Z")

</div>

> Dopus does not like Japanese characters

Opus is fine with Japanese characters, FFmpeg is confused by wrongly placed quotes.

---

<div class="post-metadata">

**Author:** ![anon30529981](https://resource.dopus.com/letter_avatar_proxy/v4/letter/a/bcef8e/32.png) [@anon30529981](https://resource.dopus.com/u/anon30529981)\
**Post date:** [November 19, 2020, 5:12pm UTC](https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192/3 "2020-11-19T17:12:46Z")

</div>

What do you mean by _wrongly placed quotes_?

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [November 19, 2020, 5:45pm UTC](https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192/4 "2020-11-19T17:45:22Z")

</div>

Opus will place quotes only around `{file}`, not around `new-{file}`. Place `echo` before the `ffmpeg` command and you'll see what I mean.

---

<div class="post-metadata">

**Author:** ![anon30529981](https://resource.dopus.com/letter_avatar_proxy/v4/letter/a/bcef8e/32.png) [@anon30529981](https://resource.dopus.com/u/anon30529981)\
**Post date:** [November 19, 2020, 6:01pm UTC](https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192/5 "2020-11-19T18:01:13Z")

</div>

Thanks for elaborating. I am still not sure if I get it.

I can change:

```auto
ffmpeg -i {file} -c copy new-{file}

```

to:

```auto
ffmpeg -i {file} -c copy "new-{file}"

```

The result will still be the same (`"new-02 ???.m4a"`). Also if I just change the Japanese characters to latin everything works fine. Are you sure we are on the right path here?

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [November 19, 2020, 6:44pm UTC](https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192/6 "2020-11-19T18:44:38Z")

</div>

DOS batch files will not properly handle characters that cannot be expressed in your locale's codepage.

That's a limitation of MS-DOS/Bat files rather than Opus.

If short names are enabled on the drive, you can pass the short version to the command, which works around the issue.

Otherwise, don't use the MS-DOS Batch Function mode. The other modes don't have any issues with Unicode. DOS is just archaic at this point.

(Setting the system locale to UTF8 may also work, but is a fairly new option which could cause issues with some software. [https://superuser.com/questions/1033088/is-it-possible-to-set-locale-of-a-windows-application-to-utf-8](https://superuser.com/questions/1033088/is-it-possible-to-set-locale-of-a-windows-application-to-utf-8) )

---

<div class="post-metadata">

**Author:** ![anon30529981](https://resource.dopus.com/letter_avatar_proxy/v4/letter/a/bcef8e/32.png) [@anon30529981](https://resource.dopus.com/u/anon30529981)\
**Post date:** [November 19, 2020, 7:21pm UTC](https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192/7 "2020-11-19T19:21:41Z")

</div>

> [@Leo](#):
>
> DOS batch files will not properly handle characters that cannot be expressed in your locale's codepage.

I must admit that this is way over my head. I can do simple PowerShell or batch files, but that is pretty much it.

> [@Leo](#):
>
> That's a limitation of MS-DOS/Bat files rather than Opus.

Then why does this batch file work for this scenario?

```auto
@echo off
FOR %%i IN (*.m4a) DO ffmpeg -i "%%i" -c copy new-"%%i"
pause

```

Seems o do the job, just not with a button.

> [@Leo](#):
>
> DOS is just archaic at this point.

The funny thing about that statement is that the reason why I am here is because I rewrote a PowerShell script to batch, just because Dopus doesn't support PowerShell and I don't know any JScript or VBScripting. Or maybe there is anything else I can use?

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [November 19, 2020, 7:25pm UTC](https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192/8 "2020-11-19T19:25:45Z")

</div>

> [@anon30529981](#):
>
> Then why does this batch file work for this scenario?

No idea, see what commands both things are generating/executing to see what the difference is. It may just be passing short names.

> [@anon30529981](#):
>
> Or maybe there is anything else I can use?

You can run a PowerShell .ps1 script from an Opus button. (You just can't put the script itself into the button.)

If you understand PS and Bat files already, JScript or VBScript should be trivial to learn as well. Have a look at the default script Opus gives you when you make a new button and switch it to script mode, and the basics should become clear just from that.

---

<div class="post-metadata">

**Author:** ![anon30529981](https://resource.dopus.com/letter_avatar_proxy/v4/letter/a/bcef8e/32.png) [@anon30529981](https://resource.dopus.com/u/anon30529981)\
**Post date:** [November 19, 2020, 7:55pm UTC](https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192/9 "2020-11-19T19:55:24Z")

</div>

> [@Leo](#):
>
> If short names are enabled on the drive, you can pass the short version to the command, which works around the issue.

Short names? What is that?

---

<div class="post-metadata">

**Author:** ![rcoleman1943](https://resource.dopus.com/user_avatar/resource.dopus.com/rcoleman1943/32/38773_2.png) [@rcoleman1943](https://resource.dopus.com/u/rcoleman1943)\
**Post date:** [November 19, 2020, 9:37pm UTC](https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192/10 "2020-11-19T21:37:28Z")

</div>

> [@anon30529981](#):
>
> Short names? What is that?

I don't know that this actually helps with the problem at hand, but to answer the question:

Once upon a time in DOS, file names were limited to eight characters (plus extension). This might have still been true in early versions of Windows. I don't know.

At some point long filenames with which we are all familiar today became allowed, but (probably for compatibility purposes) each file continued to have a short name in the background. **Somelongname.txt** would typically have a short name **SOMEL~.txt**.

I don't know to what extent these names still exist, but if in a command prompt I enter the command **dir /x** , I see them.

---

<div class="post-metadata">

**Author:** ![anon30529981](https://resource.dopus.com/letter_avatar_proxy/v4/letter/a/bcef8e/32.png) [@anon30529981](https://resource.dopus.com/u/anon30529981)\
**Post date:** [November 19, 2020, 10:41pm UTC](https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192/11 "2020-11-19T22:41:35Z")

</div>

OK thanks for all the help so far.

I am going to be honest and say that I am a little reluctant to learning VBscripting and I feel like it sort of defeats the convenience of using Dopus, but I am willing to give it a try.

Is anyone willing to help me out a little with the example at hand? I don't want people to do the job for me, but I also know that a little help will give me a kick in the right direction 😅

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [November 20, 2020, 1:04am UTC](https://resource.dopus.com/t/file-names-with-japanese-characters-in-batch-script-not-working/37192/12 "2020-11-20T01:04:04Z")

</div>

> [@rcoleman1943](#):
>
> I don't know that this actually helps with the problem at hand

Short names only use ASCII characters, and so don't cause problems with things that can't understand Unicode. They aren't always enabled anymore (and may be turned on for some drives and off for others), but if they are available then they provide a very quick and easy workaround for this kind of problem.

> [@anon30529981](#):
>
> Is anyone willing to help me out a little with the example at hand?

The default script I mentioned above will show you lots of things.

The buttons/scripts area of the forum also has lots of additional examples, and the manual has several as well.
