Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
0 + 4 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

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.

Who's Online

164 user(s) are online (120 user(s) are browsing Support Forums)


Members: 0


Guests: 164


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits