-
Notifications
You must be signed in to change notification settings - Fork 120
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
Files beginning with the Swedish characters å, ä, ö are renamed on upload #37
Comments
See 'Sort issue' added by madsenfr for the function 'latinhtmlspecialchars'. |
Fixed! Made a pull request.
Now file names with national characters are displayed properly and are preserved on uploading. |
Also refer to issue #42 for display of those chars. I am thinking.
Let me know what you think about that. PS: If fixing #42 succeeds the easy way, then this should be a piece of cake as well. |
Will make easier the implementation of marekrei#40 and later fixing of marekrei#37
Hi, |
I am planning on digging the upload issue during the next days (and hopefully fixing by finding a generic solution that meets both swedish and russian chars - depending on chosen encoding). |
I think upload should now work fine on Linux-Apache (as both, including PHP) use UTF-8 there: NewEraCracker@7300afa Let me know what happens when encode-explorer is running on Windows. Thanks. |
I've tested on a Linux-Apache server from Windows and Linux: filenames properly encoded (UTF-8) are displayed alright, but uploaded files get weird names in in both cases. |
I have committed the following change: NewEraCracker@433e5b0 Hopefully, it will now play nice. |
I've just tested uploading from Windows: it doesn't work with Swedish characters. And in a very intriguing way - the first character is omitted if the file names begins in one of the characters å ä ö Å Ä Ö - but (amasing!) those character work if they are placed somewhere else in the file name. Strange, isn't it? I tested the word "Älggräs" (= old name for meadowsweet). |
This should have dealt with the problem: NewEraCracker@d285d07 |
Congratulations! It works like a charm for Swedish: from Windows as well as from Linux/Android. Both uploading and viewing works as expected. Maybe there should be a comment with a hint to the settings for Windows: |
Already there: https://github.com/NewEraCracker/encode-explorer/blob/feature/index.php#L126 This is a little "complicated" because it depends on OS regional settings. Also took care to make everyone happy as far it was possible. PS: Thanks a lot for your feedback! It was very helpful! 😃 |
Fine! Now I know 3 ways of solving this problem, all of them works for me:
The first solution isn't any good: the php-file should be UTF-8 encoded not to cause other problems with e.g. the translations. The second is equivalent to your solution, except for that it has to be implemented as an option, as far as I can see. Further studies of encodings reveals that iso-8859-1 should be replaced by the more correct IANA code windows-1252 (I suppose it would have to be windows-1251 for Cyrillic) - making the solution even more similar to your solution. BTW Maybe a link/reference to some page on encoding standards would be fine in the comment preceding the charset option. This might help anyone using some other encoding than Western European or Cyrillic. |
uploading of files beginning in the Swedish characters å, ä, ö ( a with a ring, a with trema= two dots and o with trema = two dots) loose the first letter when uploaded. The letters are preserved alright if they are at any other place in the file name.
Apparently, the PHP-function 'basename' decodes the names alright, except for the first letter.
Using the proposed function ' latinhtmlspecialchars' + my function 'getfilename' (simple searching for the last '/´) gives exactly the same result.
Any clue?
The text was updated successfully, but these errors were encountered: