Single quote character turns into a mess

All your suggestions, requests and ideas for future development
Post Reply
penetal
Posts: 2
Joined: 21 May 2014, 19:14

Single quote character turns into a mess

Post by penetal »

First of, thanks for the great renamer. This is the third OS platform I'm using this awesome tool on.

Okay well here's the problem, when it tried to get the name of an episode with a single quote in it the name what came out was not entirely ideal.

Title in DB: He’s Bla-ack
Name that came out: Family Guy - S12E20 - He�M-^@M-^Ys Bla-ack.mkv

As you can see the ' character got turned into �M-^@M-^Y and I have no idea why

PS I can have files with single quotes in the name without problems

Code: Select all

$ touch "te'st.file" && ls -l
total 92
...other files in directory
-rw-rw-r--  1 root    Write-Config    0 May 21 21:37 te'st.file
Command Output

Sysinfo

Code: Select all

./filebot.sh -script fn:sysinfo
FileBot 4.0 (r2056)
JNA Native: 4.0.0
MediaInfo: MediaInfoLib - v0.7.52
7-Zip-JBinding: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Failed to load 7z-JBinding: /mnt/config/filebot/lib7-Zip-JBinding.so: /lib/libc.so.7: version GLIBC_2.4 required by /mnt/config/filebot/lib7-Zip-JBinding.so not found
chromaprint-tools: fpcalc version 1.1.0 (fpcalc)
Extended Attributes: DISABLED
Groovy Engine: 2.2.0
OpenJDK Runtime Environment 1.6.0_32 (headless)
64-bit OpenJDK 64-Bit Server VM
FreeBSD (amd64)
FreeBSD torrent 9.2-RELEASE-p4 FreeBSD 9.2-RELEASE-p4 #0 r262572+17a4d3d: Wed Apr 23 10:09:38 PDT 2014     [email protected]:/tank/home/jkh/build/9.2.1/freenas/os-base/amd64/fusion/jkh/9.2.1/freenas/FreeBSD/src/sys/FREENAS.amd64  amd64
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Single quote character turns into a mess

Post by rednoah »

ASCII quote:

Code: Select all

'
UNICODE quote:

Code: Select all

It's a completely different character. So ascii works and unicode doesn't.

1. Configure locale correctly
http://perlgeek.de/en/article/set-up-a- ... nvironment

2. Make sure your SSH client displays unicode correctly

3. Use Java 8 and make sure the locale is set correctly before the java call:

Code: Select all

# force JVM language and encoding settings
export LANG=en_US.utf8
:idea: Please read the FAQ and How to Request Help.
penetal
Posts: 2
Joined: 21 May 2014, 19:14

Re: Single quote character turns into a mess

Post by penetal »

Thanks, that put me on the right track. Since my setup dosen't run with a full environment I simply had to place a few more lines in the filebot.sh script that came with the package

Code: Select all

export LANG=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"
export LC_COLLATE=C
export LC_TIME="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
Then we were off to sort all the files ever, cheers.
Post Reply