I have an issue where my Swedish characters e.g Å, å, Ä, ä, Ö, ö is not showing for reasons I do not know. I uploaded some files (PDF and Doc) with the names: Verksamhetsberättelse.doc/pdf but when I want to download it , it just reads Verksamhetsberttels...? No "ä". I have tried with the other characters but came up wanting. Waz up?
Swedish Character sets not showing
-
MrSolvens
- Phoca Newbie

- Posts: 4
- Joined: 07 Apr 2014, 00:02
Swedish Character sets not showing
Hello and thank you for this fantastic component.
I have an issue where my Swedish characters e.g Å, å, Ä, ä, Ö, ö is not showing for reasons I do not know. I uploaded some files (PDF and Doc) with the names: Verksamhetsberättelse.doc/pdf but when I want to download it , it just reads Verksamhetsberttels...? No "ä". I have tried with the other characters but came up wanting. Waz up?
I have an issue where my Swedish characters e.g Å, å, Ä, ä, Ö, ö is not showing for reasons I do not know. I uploaded some files (PDF and Doc) with the names: Verksamhetsberättelse.doc/pdf but when I want to download it , it just reads Verksamhetsberttels...? No "ä". I have tried with the other characters but came up wanting. Waz up?
-
MrSolvens
- Phoca Newbie

- Posts: 4
- Joined: 07 Apr 2014, 00:02
Re: Swedish Character sets not showing
Solved. On line 60 in X:\wamp\wamp\yoursite\libraries\joomla\filesystem\file.php The regex do not follow through to Swe character sets.
Example:
public static function makeSafe($file)
{
// Remove any trailing dots, as those aren't ever valid file names.
$file = rtrim($file, '.');
$regex = array('#(\.){2,}#', '#[^A-Za-z0-9\.\_\- ]#', '#^\.#');
$regex = array('#(\.){2,}#', '#[^A-Öa-ö0-9\.\_\- ]#', '#^\.#');
return trim(preg_replace($regex, '', $file));
}
Solved then!!
Example:
public static function makeSafe($file)
{
// Remove any trailing dots, as those aren't ever valid file names.
$file = rtrim($file, '.');
$regex = array('#(\.){2,}#', '#[^A-Za-z0-9\.\_\- ]#', '#^\.#');
$regex = array('#(\.){2,}#', '#[^A-Öa-ö0-9\.\_\- ]#', '#^\.#');
return trim(preg_replace($regex, '', $file));
}
Solved then!!
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Swedish Character sets not showing
Ok
If you find Phoca extensions useful, please support the project