Shift-JIS Encoding for Linux and Wine
Now you can play with Power, supa hacka pawa nanoda.
Hello everyone, I am HerbalNekoTea, a huge fan of visual novels and Linux... which sadly did not mix well until today. Let's start by saying that this discovery and this tutorial will most likely be revolutionary to the visual novel scene. Something like inventing VXDK for Linux but it's for visual novels (and probably other Japanese games on Steam too). This tutorial will include the file required to patch your Linux distros install to support the Shift-JIS Japanese encoding, which will allow you to run your VN in Wine with way less trouble, even less with the Windows 10 Font file. This makes using native windows obsolete if you want to read VNs. It will allow any app that needs Windows with a Japanese locale to instead run with Wine (recursive acronym for "Wine is not an emulator"), but a compatibility layer that allows you to run Windows applications on Linux.
Requirements : -
Requirements : -
- A Windows 7/8.1/10 install set to a Japanase locale. A copy of Windows 7/8.1/10 set to use a Japanese locale. Please read the FAQ to see how to switch your Windows install to a Japanese locale.
- A Linux Distro of your choice. I will be using RebornOS (Antergos's successor, which is Arch Linux based) in this tutorial. I can confirm it's also working on my Debian Sid backup Linux.
- A basic understanding of terminal commands, such as copying, pasting, and executing the cd and ls commands. If you can't figure out how to copy-paste, you're either too young to be reading our translations or you're not computer-savvy enough to attempt this - in which case, just use Windows.
- A Japanese visual novel, application, game, etc. I will be using Sonohana 12 in this tutorial.
- Have both Windows and Linux already installed. If you plan to do a move and are unfamiliar with how to use Linux, I recommend using RebornOS, Linux Mint, Zorin Core/Lite, Pop!_OS or Solus Budgie.
A small example of before and after installing Shift-JIS encoding
First download the patch from mega.nz or Google Drive and decompress it somewhere else on your computer. Then, open a terminal and cd to that folder. I assume you know you can autocomplete with TAB. We are going to do our first command (this is assuming you are running an Arch Linux or Debian Base distros or any variation of them). Make sure you can see the directory (ja_JP.sjis) with the ls command.
localedef -i ja_JP -f SHIFT_JIS ./ja_JP.sjis --no-warnings=ascii
sed -i '/ja_JP.UTF-8 UTF-8/a ja_JP.SJIS SHIFT_JIS ' /etc/locale.gen
locale-gen --no-warnings=ascii
sed -i '/ja_JP.UTF-8 UTF-8/a ja_JP.SJIS SHIFT_JIS ' /etc/locale.gen
locale-gen --no-warnings=ascii
Not so hard, right? Well, that was just the first step. We've installed the Shift-JIS encoding for Japanese language... but we have another problem. The opensource font is crap and doesn't run VNs correctly. The next step will ensure that you don't have line breaking errors in your VN. Boot into Windows machine with Japanese locale. You will want to create a folder on the desktop called "Font". Open the File Explorer, go to Computer, and select your C: Drive. Go inside the Windows folder. Find your "Font" folder and open it. Now you should be getting a weird W7 legacy interface. Select the first font, but don't double click it. Scroll to the bottom and, while holding the Shift key on your keyboard, click the last font. Copy-paste it into the folder on your Desktop. Unfortunately, the CTRL+A to select all don't work in that weird folder. Now reboot back to Linux.
If you know what you're doing, you'll want to use either the command terminal or a GUI File Browser of your choice. Mount your Windows drive in your Linux and open that "Font" folder. You'll want to copy them with root access to the directory "/usr/share/wine/fonts/" and overwrite stuff if asked. Here we go, you are ready to cry with an onion cutting simulator. You can use Lutris if you prefer, I'm just old school and use the terminal for everything. Here's the magical command for running your visual novel on Wine, using Sonohana 12 as a reference, assuming you are already inside that directory:
LC_ALL=ja_JP.sjis wine ATELIER.EXE
Sonohana 12 running perfectly in RebornOS (Arch vanilla based) with the latest Gnome DE from Arch's Repo (3.34.2).
Still don't believe me ?
Still don't believe me ?
This trick should work with most VN engines. This is an example with Kirikiri 2/KAG3 Engine.
You can probably run it on MacOS, but their Wine build is so barebones that it might not even work. Shift-JIS encoding is supported by default on MacOS, so you won't need the patch. It all depends on if MacOS's Wine can run the app or not.
PS : For Lutris, go into the configuration window for the specific game/application, select the "System options" tab and add in "Environment variables" one of the following keys "LC_ALL" or "LOCAL" (depending if you want all locale or just to have the encoding only, some app will run with JP Locale but with English language if they got the option with LOCAL like the Nvidia Drivers on Windows) and "ja_JP.sjis" in the Value column.
This trick should work with most VN engines. This is an example with Kirikiri 2/KAG3 Engine.
You can probably run it on MacOS, but their Wine build is so barebones that it might not even work. Shift-JIS encoding is supported by default on MacOS, so you won't need the patch. It all depends on if MacOS's Wine can run the app or not.
PS : For Lutris, go into the configuration window for the specific game/application, select the "System options" tab and add in "Environment variables" one of the following keys "LC_ALL" or "LOCAL" (depending if you want all locale or just to have the encoding only, some app will run with JP Locale but with English language if they got the option with LOCAL like the Nvidia Drivers on Windows) and "ja_JP.sjis" in the Value column.
A big thank you to the following people who helped make this possible:
This is published under an unknown license within a clusterfuck of licenses... well, according to the Fedora's original package for this Shift-JIS encoding. It has a plethora of licenses and only one of them is the valid one. Going to name them here : "LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL" What a joke, right? Click here for original package.Personally, I have a feeling it's BSD license due to Shift-JIS being included in MacOS.
Let's make 2020 a year where visual novels will flourish beyond its limits (on Linux, at least).
-HerbalNekoTea
- Hin-Tak Leung on RedHat's Bugzilla for his post that came through my Google search for how to achieve it. Original post here.
- The RedHat and Fedora team for still providing the Shift-JIS encoding into their Linux Distros since 2002.
- To Loe from Loe Quality Translations (LQT) for his issue while working with his script, which made my discovery possible.
- To all the wonderful translation groups and businesses making this industry flourish.
- To all the Linux developers, Linus Torvald, and RMS for making this the best alternative to Windows 10.
- casual_scrub and The Secret Dragon for proofreading my post.
- Myself (HerbalNekoTea) for sharing my discovery into a practical guide to everyone in this scene.
This is published under an unknown license within a clusterfuck of licenses... well, according to the Fedora's original package for this Shift-JIS encoding. It has a plethora of licenses and only one of them is the valid one. Going to name them here : "LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL" What a joke, right? Click here for original package.Personally, I have a feeling it's BSD license due to Shift-JIS being included in MacOS.
Let's make 2020 a year where visual novels will flourish beyond its limits (on Linux, at least).
-HerbalNekoTea