aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: [1] 2 3

Author Topic: settings: new option for filesystem (filenames) encoding  (Read 20974 times)

macias

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 110
settings: new option for filesystem (filenames) encoding
« on: December 23, 2007, 03:26:32 PM »

Hello,

  Currently (I guess) aMule assumes that LANG env is corresponding with filenames encoding. But there is no guarantee for that (and my system is proof of that), so please add such option in aMule -- this way all non 7-bit characters would be properly visible "outside".

  Thank you in advance.

Merry Christmas btw :-)
Logged

lfroen

  • Guest
Re: settings: new option for filesystem (filenames) encoding
« Reply #1 on: December 23, 2007, 03:37:29 PM »

Explain please.
Logged

macias

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 110
Re: settings: new option for filesystem (filenames) encoding
« Reply #2 on: December 23, 2007, 03:53:15 PM »

I can use EN LANG setting in the system but use ISO8859-2 encoding in filenames. This works great with all apps, because older apps are not messed up with LANG different then EN and in new apps I can set encoding as I wish -- utf8, iso, etc. However only two apps I know assumes the LANG is correct for everything that comes from system (sane assumption) and do not allow any changes to it (not useful for the user). And those apps are Krusader and aMule. So in both filenames are incorrectly recognized -- for example ę is changed into spanish (?) e^.

Thus this wish, option like
Local filenames [ encoding ]

where encoding is a combobox with entries: system, iso...., utf8..., codepage, ....

would be very helpful.
Logged

lfroen

  • Guest
Re: settings: new option for filesystem (filenames) encoding
« Reply #3 on: December 23, 2007, 05:22:39 PM »

Your setup is so wrong, that I don't know where to start.
* I have never seen an application that asks "what encoding your filesystem have"
* What kind of OS is that? On Linux ext2/3 uses Unicode; IIRC same thing on OSX.
* If you're using vfat from external device, filesystem driver is taking care for names encoding. Check out manual for "mount" command options

Logged

macias

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 110
Re: settings: new option for filesystem (filenames) encoding
« Reply #4 on: December 23, 2007, 06:04:55 PM »

Your setup is so wrong, that I don't know where to start.

Nah, it is quite ok. It is different than yours, that's all.

* I have never seen an application that asks "what encoding your filesystem have"

Me too. But I've seen a lot of apps that allow user not to rely on LANG settings. KDE family for example. And this wish is example this. Since aMule does not use currency, timezone, etc. the only common thing is interpreting filenames.

* What kind of OS is that? On Linux ext2/3 uses Unicode; IIRC same thing on OSX.

Opensuse 10.3, KDE 3.5.8, reiserfs. The point is -- you CAN use unicode, it does not mean amule interpret it this way. My guess is it checks LANG first and then it interprets filenames according to LANG. So if I type
touch test.txt
dir test.txt
I will see test.txt. As well as in amule.

And when I type
touch ęóąłś.txt
dir ęóąłś.txt
(those are all polish characters) I will see ęóąłś.txt. In all apps... except amule and Krusader. Because they rely on LANG and my LANG is set to EN.

In every other app I can override LANG (Kate, Konsole, KDE itself, Kdevelop, you name it).

So maybe I rephrase my wish -- please add option to override the LANG system settings.

Logged

lfroen

  • Guest
Re: settings: new option for filesystem (filenames) encoding
« Reply #5 on: December 24, 2007, 08:27:28 AM »

"Wrong" and "different" are 2 words that describe same situation - for some reason you're messing with filename encoding vs. LANG vs. other system settings. I have no idea why are you doing that.
On my Linux (Fedora 7, ext3 root) there's files with names on three languages - Russian, Hebrew and English; and I did not touched single setting to achieve that.

Now to the point
Quote
But I've seen a lot of apps that allow user not to rely on LANG settings.
Either I missing something, or you're asking for this script:
Code: [Select]
#!/bin/tcsh
setenv LANG whatever
exec amule

Quote
So maybe I rephrase my wish -- please add option to override the LANG system settings.
See script above.
Logged

macias

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 110
Re: settings: new option for filesystem (filenames) encoding
« Reply #6 on: December 24, 2007, 10:10:47 AM »

Code: [Select]
[quote author=lfroen link=topic=14037.msg74133#msg74133 date=1198481248]
"Wrong" and "different" are 2 words that describe same situation - for some reason you're messing with filename encoding vs. LANG vs. other system settings. I have no idea why are you doing that.
On my Linux (Fedora 7, ext3 root) there's files with names on three languages - Russian, Hebrew and English; and I did not touched single setting to achieve that.

Because default one works for you. For me not -- so I dropped utf8 from LANG and it works for me to.


Quote
So maybe I rephrase my wish -- please add option to override the LANG system settings.
See script above.
[/quote]


Quote
But I've seen a lot of apps that allow user not to rely on LANG settings.
Either I missing something, or you're asking for this script:
Code: [Select]
#!/bin/tcsh
setenv LANG whatever
exec amule

Thank you but amule still recognizes polish characters (after setting LANG=pl_PL and language to Polish in amule) as non-polish.

Maybe I explain: I can type in search "żółw" (for example) and it is displayed correctly. Also amule searches for that word and if it finds anything like that it shows that and displays matches correctly. But it misses my files named "żółw", I can do a little test and rename my file to "żółw zolw" -- then if I search for "zolw" I will get that file but polish part characters are displayed (interpreted)  incorrectly as some western extended characters (except for "ó" because it is the same code and look).

To test it a bit further I applied your solution to Krusader (it is the second application that does not have settings for encoding). After
LANG=pl_PL
krusader

Krusader displays all filenames 100% correctly.

Wild guess -- could it be that amule assumes utf8 in filenames? Or anything like that.
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: settings: new option for filesystem (filenames) encoding
« Reply #7 on: December 24, 2007, 11:08:47 AM »

Try LANG=pl_PL.iso88592

I don't guarantee that it works, aMule surely doesn't handle it but the underlying wxWidgets libraries might.
Logged
concordia cum veritate

macias

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 110
Re: settings: new option for filesystem (filenames) encoding
« Reply #8 on: December 24, 2007, 11:37:43 AM »

Try LANG=pl_PL.iso88592

I don't guarantee that it works, aMule surely doesn't handle it but the underlying wxWidgets libraries might.

Thank you, I tried this, and ISO88592 and ISO-8859-2. The result is always the same, my test "ę" is shown as "e^" (one character).
Logged

lfroen

  • Guest
Re: settings: new option for filesystem (filenames) encoding
« Reply #9 on: December 24, 2007, 12:42:39 PM »

Quote
Because default one works for you. For me not -- so I dropped utf8 from LANG and it works for me to.
That's the question that should be answered first. Your settings are screwed. If you find yourself messing with LANG  - most chances you doing something you should not.

Quote
I don't guarantee that it works, aMule surely doesn't handle it but the underlying wxWidgets libraries might.
It may be a bug in wxWidgets itself - AFAIK aMule doesn't try to interpret filenames. You are welcomed to check if you see same problem in other wxWidgets based applications
Logged

macias

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 110
Re: settings: new option for filesystem (filenames) encoding
« Reply #10 on: December 24, 2007, 02:19:36 PM »

Quote
Because default one works for you. For me not -- so I dropped utf8 from LANG and it works for me to.
That's the question that should be answered first. Your settings are screwed.

Excuse me, since when LANG=en_EN is screwed? It is perfectly legal setting.  And even besides that all apps I use except two works perfectly well -- even numbers tell that it is more likely that there is something not right with those two apps than the rest of them, don't you agree?

Quote
I don't guarantee that it works, aMule surely doesn't handle it but the underlying wxWidgets libraries might.
It may be a bug in wxWidgets itself - AFAIK aMule doesn't try to interpret filenames. You are welcomed to check if you see same problem in other wxWidgets based applications

Ok, I will do some tests, first I have to find what uses wxWidgets except amule :-)
Logged

Vollstrecker

  • Administrator
  • Hero Member
  • *****
  • Karma: 67
  • Offline Offline
  • Posts: 1549
  • Unofficial Debian Packager
    • http://vollstreckernet.de
Re: settings: new option for filesystem (filenames) encoding
« Reply #11 on: December 24, 2007, 02:26:58 PM »

Excuse me, since when LANG=en_EN is screwed? It is perfectly legal setting.  And even besides that all apps I use except two works perfectly well -- even numbers tell that it is more likely that there is something not right with those two apps than the rest of them, don't you agree?

Excused. The problem is, that you tell the app, that it has encoding en_EN with for itself is legal, and your filesystem serves the filename in pl_PL or whatever with for itself again is absolutely legal. But what you see is what happens when they don't communicate and expect the other to use the same as they do. Maybe the other apps just ignore the settings you gave them and this causes them to work.
Logged
Homefucking is killing prostitution

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: settings: new option for filesystem (filenames) encoding
« Reply #12 on: December 24, 2007, 02:35:17 PM »

Try VLC, it uses wx as well.
Logged

macias

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 110
Re: settings: new option for filesystem (filenames) encoding
« Reply #13 on: December 24, 2007, 03:34:55 PM »

The problem is, that you tell the app, that it has encoding en_EN with for itself is legal, and your filesystem serves the filename in pl_PL or whatever with for itself again is absolutely legal. But what you see is what happens when they don't communicate and expect the other to use the same as they do. Maybe the other apps just ignore the settings you gave them and this causes them to work.

No, the other apps have settings to override LANG. And it is pretty sane -- there are a lot of older software that heavily rely on LANG and LANG only and do not work with extended LANG too well. So it is useful to set LANG to the most used settings (en) for the sake of them working and set it independently in modern environment to really needed encoding (iso-8859-2).
Logged

Vollstrecker

  • Administrator
  • Hero Member
  • *****
  • Karma: 67
  • Offline Offline
  • Posts: 1549
  • Unofficial Debian Packager
    • http://vollstreckernet.de
Re: settings: new option for filesystem (filenames) encoding
« Reply #14 on: December 24, 2007, 03:38:59 PM »

No, the other apps have settings to override LANG. And it is pretty sane -- there are a lot of older software that heavily rely on LANG and LANG only and do not work with extended LANG too well. So it is useful to set LANG to the most used settings (en) for the sake of them working and set it independently in modern environment to really needed encoding (iso-8859-2).

Maybe it's more usefull to upgrade this old software and use the locales in the sense of the inventor.
Logged
Homefucking is killing prostitution
Pages: [1] 2 3