Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Wrong mime type for the files with non-ascii characters
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
atzengi25atn
n00b
n00b


Joined: 22 Jan 2012
Posts: 14

PostPosted: Thu Feb 02, 2017 2:09 pm    Post subject: Wrong mime type for the files with non-ascii characters Reply with quote

Hello everyone,

Facing a strange problem in Dolphin recently.
I don't know since when it started.

For some pdf files for instance, when they have some specific non-ascii character in the filename, Dolphin does not detect the mime type correctly.
For example I have made 10 copies of the same pdf file and renamed them as they include some of the characters like "İ", "Ş", etc.
The most problematic one in my experience is the dotted capital I "İ".

When I list them in the folder they all look normal as follows,

Code:
$ ls -al
total 46616
drwxr-xr-x  2 tarik tarik    4096 Feb  2 17:03 .
drwxr-xr-x 24 tarik tarik   12288 Feb  2 16:55 ..
-rw-r--r--  1 tarik tarik 4770450 Jan 30 14:33 ABC.pdf
-rw-r--r--  1 tarik tarik 4770450 Jan 30 14:33 AİİA.pdf
-rw-r--r--  1 tarik tarik 4770450 Jan 30 14:33 DEF.pdf
-rw-r--r--  1 tarik tarik 4770450 Jan 30 14:33 GHI.pdf
-rw-r--r--  1 tarik tarik 4770450 Jan 30 14:33 İAEİ.pdf
-rw-r--r--  1 tarik tarik 4770450 Jan 30 14:33 İAİ.pdf
-rw-r--r--  1 tarik tarik 4770450 Jan 30 14:33 İİ.pdf
-rw-r--r--  1 tarik tarik 4770450 Jan 30 14:33 İŞLİ.pdf
-rw-r--r--  1 tarik tarik 4770450 Jan 30 14:33 İŞŞİ.pdf
-rw-r--r--  1 tarik tarik 4770450 Jan 30 14:33 JKL.pdf

$ file * 
                                                                                                                                                                                                 
ABC.pdf:  PDF document, version 1.4                                                                                                                                                                                                           
AİİA.pdf: PDF document, version 1.4
DEF.pdf:  PDF document, version 1.4
GHI.pdf:  PDF document, version 1.4
İAEİ.pdf: PDF document, version 1.4
İAİ.pdf:  PDF document, version 1.4
İİ.pdf:   PDF document, version 1.4
İŞLİ.pdf: PDF document, version 1.4
İŞŞİ.pdf: PDF document, version 1.4
JKL.pdf:  PDF document, version 1.4


Dolphin shows the one with "İ"s in their name as "pascal source code" files though.
Screenshot : http://imgur.com/a/kROEQ

All the files are identical except their filenames.
What do you think I should check first?
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1704
Location: United Kingdom

PostPosted: Fri Feb 03, 2017 12:52 am    Post subject: Reply with quote

Strange indeed. I don't experience that in my installation. I wonder if something is messed up in the file associations in your installation? Have you checked 'System Settings' > 'Applications' > 'File Associations'? If you enter 'pascal' in the box 'Find file type or filename pattern' you should see the following under 'Known Types' if you expand the '>-text' entry:

Quote:
v-text
....·P x-pascal

What applications are listed in the 'Application Preference Order' box if you select x-pascal?

Likewise, what do you get when you enter 'pdf' in the box 'Find file type or filename pattern'?
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
atzengi25atn
n00b
n00b


Joined: 22 Jan 2012
Posts: 14

PostPosted: Fri Feb 03, 2017 8:28 am    Post subject: Reply with quote

Thank you @Fitzcarraldo.

I can see the x-pascal as you mentioned having the extensions *.p and *.pas
The applications listed are Kate, Kwrite, Libreoffice Writer, etc.

The "pdf" mime type, it also appears under the "application" category and has the *.pdf extension only.
The applications associated are Okular, gimp, etc.

Generally I don't have a problem with these file types.
Those which have the problem turn OK when I change their name to an ascii character.

Can you rename a file in your system as shown in my first message please?
Does it react the same?
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1704
Location: United Kingdom

PostPosted: Fri Feb 03, 2017 9:28 am    Post subject: Reply with quote

Before making my first post I renamed a PDF file to AIA.pdf and then to AİA.pdf (I with a dot above it). The 'file' command and Dolphin showed both files as being PDF files.

However, as you requested me to rename a file as shown in your first post, I have renamed a PDF file to AIIA.pdf and then to AİİA.pdf (two 'I's with a dot above each). And, yes, I see the same as you! Dolphin indicates the file type is 'Pascal source code', but the 'file' command shows the PDF file type correctly:

Code:
fitzcarraldo@clevow230ss ~/Documents $ file AIIA.pdf
AIIA.pdf: PDF document, version 1.4
fitzcarraldo@clevow230ss ~/Documents $ file AİİA.pdf
AİİA.pdf: PDF document, version 1.4

So Dolphin reports the file type of AİA.pdf (one 'İ') correctly but not AİİA.pdf (two 'İ's). That is bizarre.

In 'System Settings' > 'File Associations' in my installation I notice that the list of applications for x-bzpdf and x-gzpdf includes PeaZip. As it happens, PeaZip is written in Free Pascal. I wonder if that has something to do with it. Anyway, it looks to me like a bug in Dolphin or somewhere else in KDE. Perhaps you should file a bug report in the KDE Bug Tracking System.
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
atzengi25atn
n00b
n00b


Joined: 22 Jan 2012
Posts: 14

PostPosted: Fri Feb 03, 2017 2:58 pm    Post subject: Reply with quote

I have found other file types affected with this. Most probably there are more.

Try these please;

ABC.pdf -> AİİA.pdf
ABC.odt -> AİİA.odt
ABC.docx -> AİA.docx

Renamed pdf file appears as Pascal Source Code, odt file appears as Object Code, and docx file appears as Zip Archive. Really weird.
docx is affected only with one "İ". It seems OK with double "İ"s. Another weirdness.

By the way, I have filed the bug here : https://bugs.kde.org/show_bug.cgi?id=375956
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1704
Location: United Kingdom

PostPosted: Fri Feb 03, 2017 3:37 pm    Post subject: Reply with quote

1. ABC.pdf -> AİİA.pdf
2. ABC.odt -> AİİA.odt
3. ABC.docx -> AİA.docx
4. ABC.docx -> AİİA.docx

In my case, Dolphin shows the original files above as, respectively, the following:

1. PDF document.
2. ODT document.
3. Word 2007 document.
4. Word 2007 document.

In my case, Dolphin shows the renamed files above as, respectively, the following:

1. Pascal source code.
2. object code.
3. Zip archive.
4. Word 2007 document.

In other words, exactly the same as you see.
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1704
Location: United Kingdom

PostPosted: Sat Feb 04, 2017 10:54 am    Post subject: Reply with quote

I see that KDE developer Elvis Angelaccio has acted on your bug report and filed three bug reports in the freedesktop.org bugzilla regarding the x11-misc/shared-mime-info package:

https://bugs.freedesktop.org/show_bug.cgi?id=99672 (PDF file with non-ASCII filename detected as Pascal source code)
https://bugs.freedesktop.org/show_bug.cgi?id=99673 (ODT file with non-ASCII filename detected as application/x-object)
https://bugs.freedesktop.org/show_bug.cgi?id=99674 (docx file with non-ASCII filename detected as application/zip)
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7095

PostPosted: Sat Feb 04, 2017 2:47 pm    Post subject: Reply with quote

Code:
 * Searching for xdg-mime ...
x11-misc/xdg-utils-1.1.1-r1 (/usr/bin/xdg-mime)

xdg-mime query filetype AİİA.pdf
application/pdf

*  x11-misc/shared-mime-info
      Latest version available: 1.8
      Latest version installed: 1.8


If it help you.
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1704
Location: United Kingdom

PostPosted: Tue Feb 28, 2017 12:33 am    Post subject: Reply with quote

Apparently it is a bug in Qt5 and is fixed in Qt 5.8.1:

https://bugreports.qt.io/browse/QTBUG-58822
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum