| Re: Problem with CYR character when setting value |
| by brutalicuss on 2012/6/10 13:25:20 Yes, you'r right! This is the easier way! I understand right now. I have 6 xoops sites, but for first time looked in xoopslocal... "the man learns while living" I spent much time... this will be lesson for me 10x for opening my eyes :) |
| Re: Problem with CYR character when setting value |
| by irmtfan on 2012/6/10 11:51:43 you dont need to hard code mb_substr. just use XoopsLocalAbstract::substr() instead of substr() xoops core and module developers should use xoops local functions. If developers didnt use these functions What is the usage of xoopslocal.php file and XoopsLocalAbstract class? |
| Re: Problem with CYR character when setting value |
| by brutalicuss on 2012/6/10 11:35:26 Foud for module "catads" (latest ads) Was easier (after first) :) modules/catads/blocks - file: catads_new.php replace this line: $a_item['title'] = substr($a_item['title'],0, $options[4] - $length1)."..."; with this: $a_item['title'] = mb_substr($a_item['title'],0, $options[4] - $length1)."..."; the difference is only "mb_substr" instead "substr" this call "Multibyte String" - almost all hosting company support this library These were my xoops-problems for now :) I like xoops really! |
| Re: Problem with CYR character when setting value |
| by brutalicuss on 2012/6/10 9:43:16 10x very much man, thats right, this is the real problem in "2-byte characters" After many hours reading in the net I found decision for Ohwada's WEBLINKS. I tried many "tricks" with strlen and substr but without success. Finally fix it (for all they have same problem) Its sumple: module/happy_linux - folders "class" and "include" add this funk at the beginning of files: strings.php (in class) and multibyte.php (in include) <?php mb_internal_encoding("UTF-8"); ?> Thats all! This fix any "?" END characters in any block or title or description Now looking for decision for module "catads", still have trouble with it 10x |
| Re: Problem with CYR character when setting value |
| by irmtfan on 2012/6/10 7:28:20 sorry i can not see the screenshot of your issue. but i just guess that you have problem with 2-byte characters. i think your cyrillic character need 2 bytes and with just 1 byte left in the field you have an strange ? instead. For example when you have 80 characters in maximum and you typed 79 latin characters (1 byte language) then you CAN NOT add a 2-byte character like this cyrillic character Ѳ http://en.wikipedia.org/wiki/%D1%B2 because it has 2 bytes and it will be 81 characters in total and will exceed the maximum allowed and you have the ? in return. Hope i could explain you the root of your problem. |