Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimeopen with UTF-8 characters in name #15

Closed
Paul-Gilmartin opened this issue Jun 25, 2015 · 4 comments
Closed

mimeopen with UTF-8 characters in name #15

Paul-Gilmartin opened this issue Jun 25, 2015 · 4 comments

Comments

@Paul-Gilmartin
Copy link

Hello, Michiel,

Earlier I submitted this by email to pardus@cpan.org. I now see I should be using GitHub.

Hello, Jaap,

I have in mimeopen:

No known bugs, please mail the author if you find one.

See File::MimeInfo::Applications(3) and File::DesktopEntry(3)
for some limitations.
...
Copyright (c) 2002, 2012 Jaap G Karssenberg. All rights reserved.

And then a strangely UTF-8k named file:

515 $ Movie="L'Odyssée Cartier.flv"
516 $ ls -l "$Movie"
-rwxrwx--- 1 root vboxsf 13225664 Mar 26 2012 L'Odyssée Cartier.flv
517 $
517 $ # So far so good. But:
518 $
518 $ mimeopen -L -n "$Movie"
Opening "L'Odyssée Cartier.flv" with VLC media player (video/x-flv)
VLC media player 2.0.3 Twoflower (revision 2.0.2-93-g77aa89e)
[0x8f26908] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0x925bf00] filesystem access error: cannot open file /media/sf_Shared/L'Odysse??e Cartier.flv (No such file or directory)
[0x9255930] main input error: open of `file:///media/sf_Shared/L'Odyssée Cartier.flv' failed

I notice the 0x925bf00 message has the filename corrupted, but 0x9255930
renders it correctly.

Have I stumbled into one of the limitations mentioned?

If I simply click on the file's icon in Thunar File Manager, Thunar opens it correctly with VLC.

Thanks,
gil

@Paul-Gilmartin
Copy link
Author

(more) The version of mimeopen delivered with Crunchbang Linux is 0.15.
I downloaded and installed 0.27. It shows the same misbehavior

The offending character is 'COMBINING ACUTE ACCENT' lower-case "e".:
589 $ printf é | od -tx1
0000000 65 cc 81
... if I delete it from the pathname, mimeopen handles it OK.

Thanks,
gil

@mbeijen
Copy link
Owner

mbeijen commented Jun 25, 2015

Hi Paul,

If I create such a file on my system I can open it correctly.

I notice you open the file from /media/sf_Shared/ - can you please tell me
what kind of file system it uses?

Michiel

On Thu, Jun 25, 2015 at 4:02 AM, Paul-Gilmartin notifications@github.com
wrote:

(more) The version of mimeopen delivered with Crunchbang Linux is 0.15.
I downloaded and installed 0.27. It shows the same misbehavior

The offending character is 'COMBINING ACUTE ACCENT' lower-case "e".:
589 $ printf é | od -tx1
0000000 65 cc 81
... if I delete it from the pathname, mimeopen handles it OK.

Thanks,
gil


Reply to this email directly or view it on GitHub
#15 (comment)
.

@Paul-Gilmartin
Copy link
Author

Hello, Michiel,
Thanks for your quick reply.

I thought I had eliminated VLC as a suspect with:

619 $ vlc "/media/sf_Shared/L'Odyssée Cartier.flv"

with successful open. But, trying the command generated by mimeopen:

616 $ vlc "file:///media/sf_Shared/L'Odyssée Cartier.flv"
VLC media player 2.0.3 Twoflower (revision 2.0.2-93-g77aa89e)
[0x2105108] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0x23f82a8] filesystem access error: cannot open file /media/sf_Shared/L'Odysse??e Cartier.flv (No such file or directory)
[0x2136738] main input error: open of `file:///media/sf_Shared/L'Odyssée Cartier.flv' failed

So, in RFC 1738"

URLs are written only with the graphic printable characters of the
US-ASCII coded character set. The octets 80-FF hexadecimal are not
used in US-ASCII, and the octets 00-1F and 7F hexadecimal represent
control characters; these must be encoded.

So I try:

622 $ vlc "file:///media/sf_Shared/L'Odysse%cc%81e Cartier.flv"
VLC media player 2.0.3 Twoflower (revision 2.0.2-93-g77aa89e)
[0x1d8f108] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[flv @ 0x7f4e10026460] Estimating duration from bitrate, this may be inaccurate
[flv @ 0x2c0f1a0] Estimating duration from bitrate, this may be inaccurate
[0x2c396e8] xcb_xv vout display error: no available XVideo adaptor

The message is harsh, but the movie opens OK. VLC isn't adhering
to Postel's principle very well.

Since you asked, I'm running Crunchbang Linux as a guest under
VirtualBox and the filesystem is a "shared folder" managed by
the VirtualBox hypervisor. But that doesn't appear to be a
contributing factor.

623 $ df -kT
Filesystem Type 1K-blocks Used Available Use% Mounted on
rootfs rootfs 19513212 5064736 13457244 28% /
udev devtmpfs 10240 0 10240 0% /dev
tmpfs tmpfs 50880 628 50252 2% /run
/dev/mapper/gil--crunchbang-root ext4 19513212 5064736 13457244 28% /
tmpfs tmpfs 5120 0 5120 0% /run/lock
tmpfs tmpfs 101740 84 101656 1% /run/shm
/dev/sda1 ext2 233191 18379 202371 9% /boot
none vboxsf 78381056 63319508 15061548 81% /media/sf_Shared

Thanks again,
gil

@GSI
Copy link

GSI commented Dec 16, 2019

I confirm that opening files with umlauts in their names works with https://github.com/skalkoto/File-MimeInfo/commit/60d390cf1b1dfbcf039e850093e49d5f6e590d21. Please consider merging.

Without the patch (mimeopen 0.29):

Opening "bücher.pdf" with MuPDF  (application/pdf)
error: cannot open bücher.pdf: No such file or directory
mupdf: error: cannot open document

With the patch:

Opening "bcher.pdf" with MuPDF  (application/pdf)

Notice that the ü is missing in the command line output, but the file still opens as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants