#1 2010-11-01 23:07:13

lzap
New member
Registered: 2010-11-01
Posts: 3

[Patch] Diacritics removal from image file names

Hello,

all characters with diacritics get converted to underscore so cover images for entries like "Francé" are stored as Franc_0.jpg. In languages where diacritics are very common (like Czech) words like "Štěstí" are stored in unreadable format "_t_st_0.jpg". Not a big issue but not nice when you browsing the image folder.

I have created new two functions that use standard Perl 5 library Unicode::UCD which is distributed with Perl 5 and modified the function getSafeFileName. Diacritics is stripped down prior to underscore translation so the above examples are correctly stored as "France" and "Stesti" respectively.

The UCD module documentation is at http://search.cpan.org/~jesse/perl-5.12 … ode/UCD.pm

I was thinking about enclosing the stripUnicodeDiacritics call with eval to prevent potential problems when Unicode is not available in Perl but the above module is available for a long time now. Shouldn't be a problem. Opinions?

Attaching unified patch created with Subversion (latest trunk from tonight).


Attachments:
Attachment Icon diacritics_removal.patch, Size: 1,356 bytes, Downloads: 426

Offline

 

#2 2010-12-11 21:31:41

lzap
New member
Registered: 2010-11-01
Posts: 3

Re: [Patch] Diacritics removal from image file names

No comment at all?

Offline

 

#3 2010-12-12 15:12:48

Halibutt
Member
From: Warsaw
Registered: 2007-05-12
Posts: 19
Website

Re: [Patch] Diacritics removal from image file names

Mate, I'd really love to see this implemented. Especially that most of my books are in Polish and Czech. Do you know how to apply this by hand in a Windows version? Is it possible at all?

Unfortunately GCstar tends to have many more serious Unicode problems than this one (I kind of got used to it), for instance this one or this one.
Cheers

Last edited by Halibutt (2010-12-12 15:13:35)


Why oh why is writing plugins for GCStar so complicated...

Offline

 

#4 2010-12-12 15:52:25

lzap
New member
Registered: 2010-11-01
Posts: 3

Re: [Patch] Diacritics removal from image file names

@Halibutt: The patch is attached, you can open it as a text file and edit the file itself but I'd rather recommend to use a GNU patch or WinDiff utility.

Offline

 



Should you have a problem using GCstar, you can open a bug report or request some support on GCstar forums.