#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    6
    Rep Power
    0

    Problem with mb_substr and length?


    Hello, I use the mb_substr for cyrillic language(multi-byte chars) to prevend the text to get out of the div space I put it in.But when I use numbers and punctuation of the text length varies due to differences in the length of the non-Cyrillic characters. How can you make the text to be the same length? Is it possible revision of the text to identify the length of characters in the same way?

    Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,381
    Rep Power
    594
    What encoding are you using? I believe you need cp1251 to get 1 byte encoding so that the right values are returned for Cyrillic characters.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    6
    Rep Power
    0
    Originally Posted by gw1500se
    What encoding are you using? I believe you need cp1251 to get 1 byte encoding so that the right values are returned for Cyrillic characters.
    I'm using UTF-8(also database is UTF-8),but i'll test it with cp1251.Thanks for the suggestion I didn't know that cp1251 will make the cyrillic chars to 1 byte.

    EDIT:I decided to go with max-height and overflow:hidden coz remaking the whole site to cp1251 will be pain in the a**.

IMN logo majestic logo threadwatch logo seochat tools logo