Actually, you should probably also change
if ($case == 'true') $id = strtolower($text);
else $id = $text;
into
if ($case == 'true') $id = mb_convert_case($text, MB_CASE_LOWER, 'UTF-8');
else $id = $text;
since strtolower causes more issues than strtoupper (who miht just forget
to put unknown characters to uppercase).
Cheers,
Tiffany
Le samedi 26 septembre 2015 11:37:31 UTC+2, Tiffany Grenier a écrit :
>
> *FOUND IT!*
>
> Hi,
> I'm very happy to have solved my problem. It was jst a matter of extending
> your fix. Maybe you did this on your side already but did not put it in the
> email, or maybe you have other changes that affect this...
> But I took more time to look at the BOLTtranslate function, and it appears
> that there is another call to strtolower that wasn't turned into a call to
> mb_strtolower...
>
> And the result is the following (see bold line for change, rest is for
> context curpose):
>
> if (empty($BOLTlanguageArray[$language])) {
> if (BOLTexists("site.language.$language")) $content =
> BOLTloadpage("site.language.$language");
> if ($content == '') return $text;
> * if ($case == 'true') $content = mb_convert_case($content, MB_CASE_LOWER,
> 'UTF-8');* //WE HAVE TO FILL $BOLTlanguageArray CORRECTLY OR THE UTF-8
> WORLD MIGHT COLLAPSE
> preg_match_all('/^(.+) \:\: (.+)?/m', $content, $matches);
> $BOLTlanguageArray[$language] = array_combine($matches[1], $matches[2]);
> }
>
> Cheers,
> Tiffany/Maelite
>
> Le vendredi 25 septembre 2015 14:07:34 UTC+2, Dan a écrit :
>>
>> I don't have any additional ideas. As I mentioned everything is working
>> fine on my installation. You could try doing a clean install on BoltWire,
>> and loading the language file from within BoltWire and see if that works
>> for you. If not, it may be something in your server environment. Are the mb
>> string functions enabled?
>>
>> Cheers,
>> Dan
>>
>> On Fri, Sep 25, 2015 at 1:39 AM Tiffany Grenier <[email protected]>
>> wrote:
>>
>>> Hi,
>>>
>>> I also tried adding ini_set('default_charset', 'UTF-8'); to my
>>> index.php...
>>> Also, I tried replacing in library.php (line 1263 or so) the header by
>>> header('Content-Type: text/html; charset=utf-8');
>>> but it still did not change anything. It could still be a good addition
>>> to BoltWire, though.
>>>
>>> What astonishes me is that all my other accents are perfectly fine. Only
>>> the ones coming from some translation are weird...
>>>
>>> Regards,
>>> Tiffany
>>>
>>> Le vendredi 25 septembre 2015 08:22:48 UTC+2, Tiffany Grenier a écrit :
>>>>
>>>> Hi Dan,
>>>>
>>>> With the change you proposed, now it displays "CR?ER" instead of
>>>> "CRÉER". So it really seems I have some double-encoding issue... And I
>>>> really think that once this double-encoding thing is fixed, your fix will
>>>> be a real improvement for me :-)
>>>> In my skin html file, I do have <meta http-equiv="Content-Type"
>>>> content="text/html; charset=utf-8" /> and I am using always Notepad++
>>>> because it allows me to check the file encoding, and even to convert the
>>>> file to another encoding if it pleases me. That's why I can tell you for
>>>> sure that *all* my files, including the library script,
>>>> site.language.fr and the .html one are encoded in UTF-8.
>>>>
>>>> After inverstigating a moment, I found out that on my
>>>> server mb_internal_encoding() returns ISO-8859-1!! I forgot to think
>>>> about that... So I added mb_internal_encoding("UTF-8") to my index.php
>>>> file... but it still doesn't do the trick... It did not change anything,
>>>> but the returned value of mb_internal_encoding()...
>>>>
>>>> Any other advice?
>>>>
>>>> Cheers,
>>>> Tiffany/Maelite
>>>>
>>>> Le jeudi 24 septembre 2015 16:46:27 UTC+2, Dan a écrit :
>>>>>
>>>>> Hi Tiffany,
>>>>>
>>>>> I've tried to make BoltWire utf-8 compatible, but count on users to
>>>>> let me know when there are problems as I don't use internationalization
>>>>> much myself.
>>>>>
>>>>> Here's one fix that will help: in library.php starting around line
>>>>> 2056 replace the last part of the BOLTtranslate function with these lines:
>>>>>
>>>>> if ($text == strtoupper($text)) return mb_convert_case($out,
>>>>> MB_CASE_UPPER, 'UTF-8');
>>>>> if ($text == ucwords($text)) return mb_convert_case($out,
>>>>> MB_CASE_TITLE, 'UTF-8');
>>>>> if ($text == ucfirst($text)) return mb_convert_case(mb_substr($out, 0,
>>>>> 1), MB_CASE_UPPER, 'UTF-8') . mb_substr($out, 1);
>>>>> return $out;
>>>>> }
>>>>>
>>>>>
>>>>> It should help with the capitalization problem.
>>>>>
>>>>> As for the black diamonds in your links and buttons -- I tried both on
>>>>> my system and they worked fine. My first thought is you are having one of
>>>>> two problems.
>>>>>
>>>>> 1) You are not properly identifying the encoding type in your skin's
>>>>> html as utf-8, (content type meta tag), or more likely,
>>>>>
>>>>> 2) You are using a code editor to modify your site.lang.fr page that
>>>>> does not support utf-8. My code editor does not encode files properly, so
>>>>> for pages with utf-8 I have to be very careful to edit it through
>>>>> BoltWire
>>>>> or I will get the same results as you. Try opening and resaving the
>>>>> language file in BoltWire.
>>>>>
>>>>> Let me know if neither of the above options solve your problem and I
>>>>> can try and help some more. But it's hard for me to debug something if I
>>>>> can't reproduce the bug.
>>>>>
>>>>> Cheers,
>>>>> Dan
>>>>>
>>>>> PS. I'll put the code above in the next release. Thanks for catching
>>>>> this!
>>>>>
>>>>> On Thu, Sep 24, 2015 at 1:36 AM Tiffany Grenier <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Just found
>>>>>> https://www.daniweb.com/programming/web-development/threads/342307/utf-8-encoding-issues-with-strtolower
>>>>>> This explains everything, but does not solve my issues without a few
>>>>>> changes that would need heavy testing...
>>>>>> I don't remember if Boltwire is supposed to be UTF8-compatible or
>>>>>> not... If not, maybe I can write a plugin...
>>>>>>
>>>>>>
>>>>>> Le jeudi 24 septembre 2015 08:32:59 UTC+2, Tiffany Grenier a écrit :
>>>>>>>
>>>>>>> Hi,
>>>>>>> I am a bug I can't locate... Thus, I seek your help.
>>>>>>> In site.language.fr, I have translated "create" by "créer", but
>>>>>>> [[action.create|+]] shows "cr��er". If I write [[action.create|créer]]
>>>>>>> the
>>>>>>> problem is solved. Do you have any idea why?
>>>>>>> I have checked that all files are encoded in UTF-8, so the problem
>>>>>>> must come from somewhere else, and I can't figure where in the
>>>>>>> translation
>>>>>>> process the encoding of characters is changed...
>>>>>>> Any help appreciated.
>>>>>>> Cheers,
>>>>>>> Tiffany/Maelite
>>>>>>>
>>>>>>> P.S.: it also seems that if I write a button [submit CREATE] there
>>>>>>> is almost no bug (output is CRéER instead of CRÉER) while a button
>>>>>>> [submit
>>>>>>> create] has the same issue as the link. I checked with the ++ markup,
>>>>>>> and
>>>>>>> result is similar as what I noticed with the button. A problem with the
>>>>>>> case, then?
>>>>>>> Maybe it comes from the fact that the default encoding in my server
>>>>>>> is not UTF-8 and thus strtolower and strtoupper are not able to do
>>>>>>> their
>>>>>>> jobs right...
>>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "BoltWire" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to [email protected].
>>>>>> To post to this group, send email to [email protected].
>>>>>> Visit this group at http://groups.google.com/group/boltwire.
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "BoltWire" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/boltwire.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/boltwire.
For more options, visit https://groups.google.com/d/optout.