-
Notifications
You must be signed in to change notification settings - Fork 719
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
strtolower in Autoloader.php won't work using tr_TR locale #155
Comments
Also there's other places it won't work, like in loadPlugin, probably other places too. |
Suggest using mb_strtolower instead if PHP is compiled with multibyte string function. |
According to my git log, I tried (on Jan 6, the day I reported it), to use mb_strtolower, and it worked like a charm as I was having a site using the tr_TR locale at this time, so yes, it look like the right fix. |
Great!! |
@JulienPalard I can confirm this issue still exists. I've beem doing a little debugging, but it seems we need to fix I've been looking through a couple of bugreports on bugs.php.net and they don't sound encouraging: https://bugs.php.net/bug.php?id=18556 Could you help in creating a PR and test it the tr_TR.utf8 locale? Remember to delete compiled templates regularly to trigger a fresh compile. |
We've just run into this with https://github.com/pkp/ojs, which uses Smarty. In our own code, we resolved it with a special set of functions that are intended for "codesafe" uses (i.e. not locale dependent). See https://github.com/pkp/pkp-lib/blob/master/includes/functions.inc.php#L273..L281 for an example. I'd suggest a similar solution for calls to |
…. for Turkish locale)
A proposed PR for this: #586 |
(I'm hoping someone can have a look at the PR I proposed above! We continue to field requests from Turkish-language users of Open Journal Systems who are running into the bug.) |
Hi @asmecher https://ojs3305test.adlitip.net/index.php/itd/index I can confirm that I can directly install OJS 3.3.0.5 by selecting Turkish locale (alone) and then generate the first journal in the Turkish backend. Thank you very much for your efforts. Regards, |
@drugurkocak, to clarify, was your test done with the pull request I proposed above (#586) in place, or without any changes to OJS? If you were able to test successfully without any changes to Smarty, I suspect it's because your server doesn't have the Turkish locale installed/enabled, so the |
Hi @asmecher Whereas on Centos Server which is 2 years old, So, I will install and enable Turkish locale on Ubuntu server, and retest on both. Then, I will share the result in a few days. |
PHP RFC: Locale-independent case conversion corrects it for PHP 8.2. |
…for translating user string to filenames etc. Fixes smarty-php#155
smarty is using strtolower in Autoload.php but have classes using capitalized "i", this won't work using the tr_TR.utf8 locale:
Notice the still capitalized I.
Ensure you
dpkg-reconfigure locales
and install the "tr_TR.utf8" before doing the test, having "tr_TR.utf8" in the first lines shows that the setlocale worked, if you have bool(false), the setlocal did not change the locale so the strtolower test may wrongly succeed.This happen because in their country they have dotted and undotted i, see: https://en.wikipedia.org/wiki/Dotted_and_dotless_I
The text was updated successfully, but these errors were encountered: