changeFilenameCode

Dolphin Service Menus

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

Description:
Service menu to convert filenames from and to utf-8

***
When you have files named with special characters as é è à ô etc. and a system using utf-8 you may have some problems. Old files created before your utf-8 system or files comming from windows may be encoded using iso-XXX charater set. So they will be badly displayed ! (usualy a square in place of character)
This service menu is designed to repair that by converting your filenames to and from utf-8.

***
Requirement:
- iconv : http://www.gnu.org/software/libiconv/
- bash : http://www.gnu.org/software/bash/

***
Install:
- extract files
- copy the encodeRename.sh bash script somewhere in your PATH
(make sure it is executable)
- copy the changeFilenameCode.desktop to
- ~/.kde/share/apps/konqueror/servicemenus/ for only one user
- /usr/share/apps/konqueror/servicemenus/ (as root) for all users
- edit changeFilenameCode.desktop to set up your code
ie: replace iso-8859-1 which is code for French characters
- restart konqueror

***
Author: JJL
Home Page: http://kubuntu.free.fr/servicemenu/
Last changelog:

0.2 02/11/2005 add french translation
also works for directories (thanks to bobuse)
0.1 23/10/2005 first release


Ratings & Comments

11 Comments

Tadu

Why not use the convmv utility instead of a hand-grown script that does only half of the job? Instead of this script one could just install convmv and run it once and be done with it. -> bad.

bobuse

Hi I've discovered the tool convmv, that do the job of your shell script. This tool could too act recursively :-) I've created another servicemenu : http://www.kde-apps.org/content/show.php?content=31400

nicodietrich

Hi!! Your tool is nice. I have a suggestion: It would be nice to be able to convert filenames recursively (automatically going into directories). Ideally that could be done with an extra "-r" option for the encodeRename.sh script. (and is not really needed inside the servicemenu entry). Thanks!!

jjl

Thanks for your comment. I will look at such an option but this should complicate the script a bit :) Anyway you could do that with a find command (from iso-8859-1 to utf-8) : find . -type f -execdir encodeRename.sh iso-8859-1 utf-8 {} \; (This works only for files)

penturon

Thank's. This is a very useful Service Menu addon.

collinm

add an option to convert the content of the file...

bobuse

Why enable this servicemenu only for files ? Rename directory could be usefull. Just replace all/allfiles by all/all in changeFilenameCode.desktop

bobuse

In addition the script "encodeRename.sh" need a modification. Just before the last instruction (mv), insert "[ -d $old ] && cd .."

jjl

Yes, that's a good idea (up to now I've only had the problem on files). I've done new version including directories. Thanks

zefo

which one? there is more than one (ISO8859-1, ISO8859-2, 3, 4..)

jjl

Default value is ISO-8859-1. To change it, juste edit the changeFilenameCode.desktop file and replace iso-8859-1 (on the 2 Exec lines) by your needed code. You can use any code supported by iconv.

Pling
0 Affiliates
Details
license
version 0.2
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

More Dolphin Service Menus from jjl:

exifDate
jjl
last update date: 19 years ago

Score 5.0

Other Dolphin Service Menus:

burnWithGrowisofs
chunkylover
last update date: 20 years ago

Score 5.0

Firefox-bookmarks service menu
storyteller
last update date: 20 years ago

Score 5.0

Text Convert Service Menu
smp-penguin
last update date: 21 years ago

Score 5.0

Pdflatex servicemenu
bobuse
last update date: 20 years ago

Score 5.0

Send through Bluetooth
dmnet
last update date: 21 years ago

Score 5.0

Add to Bloglines
spookster
last update date: 20 years ago

Score 5.0



System Tags