https://github.com/kosmx/utf-8_transcoder
Convert windows-retard encodings to UTF-8, but leave utf-8 files
https://github.com/kosmx/utf-8_transcoder
character-encoding utf-8
Last synced: 11 months ago
JSON representation
Convert windows-retard encodings to UTF-8, but leave utf-8 files
- Host: GitHub
- URL: https://github.com/kosmx/utf-8_transcoder
- Owner: KosmX
- Created: 2021-12-12T14:10:05.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-06T10:20:48.000Z (almost 2 years ago)
- Last Synced: 2025-01-27T14:40:10.976Z (about 1 year ago)
- Topics: character-encoding, utf-8
- Language: Java
- Homepage:
- Size: 178 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# utf-8_transcoder
## Convert windows local encodings to UTF-8, but leave UTF-8 files
---
I'm just trying to solve the most annoying issue of Windows OS:
Random local encodings.
This is a java program, what converts local-encoded files into UTF-8. But not touch anything else.
`java -jar transcode.jar ".+\.((txt)|h|c|(cpp))" "windows-1250" "dir/to/recode/recursively"`
Usage:
1. copy `transcode` into a folder, in your path.
2. Edit the `FROM_ENCODING="windows-1250"` line, replace your source encoding (This is the default for Hungary)
3. `gradle build`, then copy `build/libs/transcoder-***.jar` into the same folder, you copied `transcoder`
4. `chmod +x transcoder`
You might want to edit the regex to inclide other file extensions.
The program doesn't recognise binary so you'll have to filter files using extension. (as any binary is a valid *windows-retard-encoding* encoded file)
## Windows
Because this is a Java program, you can run it on anywhere, but I don't know how-to make a proper wrapper script for windows.
Alternatively you can use [WSL](https://docs.microsoft.com/en-us/windows/wsl/) on Windows for this.