[JAVA] Notes on character encoding when migrating from windows to Mac

When migrating from windows to mac, if the character code of the Java file is sjis, a compile error will occur on Mac.

Here are the steps to convert files for Mac.

NKF installation

Search with nkf. Maybe you can download it from Vector

How to use

nkf -wLm --overwrite **/*.java Convert to Utf8 with line feed code for Mac But only the files in the current folder are converted (maybe)

Convert in all folders under the current folder

In windows, it corresponds with a batch file for /r %%i in (*.java) do nkf -wLm --overwrite %%i

%% i is the full path of the file name. Please check before using.

Recommended Posts

Notes on character encoding when migrating from windows to Mac
Notes on migrating from CircleCI 1.0 to 2.0
How to write and notes when migrating from VB to JAVA
Notes on building Kotlin development environment and migrating from Java to Kotlin
Changes when migrating from Spring Boot 1.5 to Spring Boot 2.0
Changes when migrating from Spring Boot 2.0 to Spring Boot 2.2
Precautions when migrating from VB6.0 to JAVA
Ruby on Rails Tutorial Troublesome notes when running on Windows
Docker for Windows: MySQL container does not start when migrating from Hyper-v to WSL2
Migrating from vargrant to docker
ClassCastException occurs when migrating from Java7 to Java8 ~ Generics and overload ~
[Opens aml] NoClassDefFoundError occurs when migrating from Tomcat to weblogic
Steps to install samba on CentOS 8 and connect from Windows 10 Explorer
Shortcut comparison for those migrating from Eclipse to IntelliJ IDEA (Windows)
What I thought about when I started migrating from Java to Kotlin
Error when npm install on Windows 7
[Java] How to update Java on Windows
How to install ImageMagick on Windows 10
Encoding when getting in Windows + Ruby
Upgrade from MYSQL5.7 to 8.0 on CentOS 6.7
Avoid Java encoding errors that occur when running FitGen.exe on Japanese Windows
Notes on what to do when EC2 is set up with t2.micro
Notes on what to do when a WebView ClassNotFoundException occurs in JavaFX 12
How to check Java installed on Mac
When Gradle build stops when importing on Mac
Language summary to learn from now on
How to install Eclipse (Photon) on Mac
How to switch Java versions on Mac
Story when moving from Spring Boot 1.5 to 2.1
Troubleshooting when raising Mastodon from v3.0.x to v3.1.x
RDP connection from Windows 10 to Ubuntu Desktop 20.04
Connect with VS Code from a Windows client to Docker on another server
Summary of points I was worried about when migrating from java to kotlin
[Java] Corrective notes for "Invalid escape character" and "Cannot map to encoding MS932"