Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Hello, KK :)

Take a look, please, - seems a little bug there.
There is a codepage issue with the (non-eng) NAME of default generated page . All the other non-eng names work fine.

Please, see the attached pics.

PS This issue stays apart and is not connected with transliteration.

Attachments

Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
@trendoman,

I agree that is bug in display.

As you might be aware, we are in a advanced stage of the process of completely replacing the existing admin-panel with a new design (and code). As this bug is not a show-stopper, do you think we can skip rectifying it at this point? The new design will not have this problem, I can assure you.
Yep. :)

For those, who might be interested. I researched the bug :twisted: and found the source of it.
Seems, some php functions like strlen and substr do not give a damn about utf-8 words. The bug basically happens when a multi-byte character gets cut in half.
Instead, we need to use mb_substr and mb_strlen, with specified encoding.
http://stackoverflow.com/questions/12446877/php-is-it-possible-to-correctly-substr-a-utf-8-string
http://stackoverflow.com/questions/9087502/php-substr-function-with-utf-8-leaves-marks-at-the-end

Or, maybe use utf8_decode like in this example:
http://chrismarslender.com/2013/03/09/phps-strlen-function-sometimes-produces-unexpected-results/

Hope to be helpful. :mrgreen:
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Partial solution "for designers":

Find edit_pages.php in Couch folder.
Search for line 1138 and change this string:
Code: Select all
$abbr_title = (strlen($p['page_title'])>20) ? substr($p['page_title'], 0, 20) . '…' : $p['page_title'];

to exactly this:
Code: Select all
$abbr_title = (strlen($p['page_title'])>20) ? mb_substr($p['page_title'], 0, 20, "utf-8") . '…' : $p['page_title'];


Save, revisit the template and admin panel and
Voila!
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
@KK,

After correcting most codepages, I encountered another place: in dropdown selection of root folder, in dynamic folders.
It nested pages everything is fine, but with dynamics it is still showing that nasty thing.

What couch file should I search for pinpointing this?
I'm here trying to save some of your time with correcting this, i will find everything myself, just let me know where to search..

Thanks.

Attachments

Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
SOLVED.

EDIT:
Coming back to this old thread to update with solution for folder titles in folder list and folder dropdown.

couch/edit-folder.php Line 414, 416. Solved Cyrillic problem with mb_string
couch-folder Line 749, 751. the same as above. + line 747 for longer titles in dropdown.

Code: Select all
---folder.php, starting at line 747---

            //$avail = 30;
            $avail = 50;
            //if( $len_pad+strlen($f_title) > $avail ){
            if( $len_pad+mb_strlen($f_title,'utf-8') > $avail ){
               // $abbr_title = ( ($len_pad<$avail) ? substr($f_title, 0, $avail-$len_pad) : substr($pad, 0, $len_pad-$avail) ). '&hellip;';
                $abbr_title = ( ($len_pad<$avail) ? mb_substr($f_title, 0, $avail-$len_pad, 'utf-8') : mb_substr($pad, 0, $len_pad-$avail, 'utf-8') ). '&hellip;';


Code: Select all
--edit-folders.php, starting at line 414 ---


                $avail = 60;
                // if( $len_pad+strlen($f->title) > $avail ){
                if( $len_pad+mb_strlen($f->title, 'utf-8') > $avail ){
                   // $abbr_title = ( ($len_pad<$avail) ? substr($f->title, 0, $avail-$len_pad) : substr($pad, 0, $len_pad-$avail) ). '&hellip;';
                    $abbr_title = ( ($len_pad<$avail) ? mb_substr($f->title, 0, $avail-$len_pad, 'utf-8') : mb_substr($pad, 0, $len_pad-$avail, 'utf-8') ). '&hellip;';




2-solved.png
2-solved.png (6.85 KiB) Viewed 2411 times

1-solved.png
1-solved.png (3.8 KiB) Viewed 2411 times
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
6 posts Page 1 of 1