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

German special characters are weird on OSX #7

Open
hirasso opened this issue Mar 11, 2017 · 2 comments
Open

German special characters are weird on OSX #7

hirasso opened this issue Mar 11, 2017 · 2 comments

Comments

@hirasso
Copy link

hirasso commented Mar 11, 2017

Hi there,

your plugin looks so great, but I always had issues to get it to work. Today I had a bit of time to play around with it, and this is what I found out: When I create a file like Ä ö ü.jpg and upload it, the file name doesn't get changed. The german letters just don't match (I tested it).

Now comes the weird part: If I copy the letters from Finder to your script, replacing your (actually correct) german special chars:

    '/Ä/' => 'ae', '/Ö/' => 'oe', '/Ü/' => 'ue', '/ß/' => 'ss',
    '/ä/' => 'ae', '/ö/' => 'oe', '/ü/' => 'ue',

...it suddenly works! It seems like on OSX, an Ä is not represented as the German letter, but as an A with a double-point accent on top (like the french letters). I hope I make myself clear.

The solution would maybe be to just also put my posted code in your array, just after the 'real' german special chars. They look the same, but seemingly they aren't...

@hirasso
Copy link
Author

hirasso commented Mar 11, 2017

More about my System Settings:
– OSX Language: English
– Keyboard Layout: German

When i edit the above characters afterwards, placing the caret for example after the Ä and the pressing backspace, first the dots disappear and with the second press also the A disappears. They seem to really be different character types to german Umlauts.

@hirasso
Copy link
Author

hirasso commented Mar 11, 2017

Adding this line to your code, just before the return, would solve edge cases like this out of the box:

$friendly_filename = preg_replace('/[^A-Za-z0-9\-.]/', '', $friendly_filename);

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

1 participant