#105 incorrect word wrap with utf-8 as default charset

closed-fixed
nobody
None
5
2005-11-06
2004-10-09
No

There is a problem using utf-8 as a default charset.
When composing a message the text is wrapped
(probably by sqWordWrap function) at the wrong
position, because input string is assumed to be 8-bit.
For example, Russian characters are represented by
two bytes in utf-8, so Russian lines are two times
shorter in the messages sent by SM.

Example (sent from SM 1.5.1cvs):

????????? ????????? ?????????
????????? ????????? ?????????
????????? ????????? ?????????
????????? ????????? ?????????

qwertyuio qwertyuio qwertyuio qwertyuio qwertyuio
qwertyuio qwertyuio
qwertyuio qwertyuio qwertyuio qwertyuio qwertyuio
qwertyuio qwertyuio

(English lines are twice as long as Russian ones).

Discussion

  • Tomas Kuliavas

    Tomas Kuliavas - 2005-01-10

    Logged In: YES
    user_id=225877

    you can call it wrapping of multibyte texts issue. It is not
    specific to 1.5.1cvs. There are two affected functions.
    sqWordWrap and sqBodyWrap. sqWordWrap can be fixed easily
    because code is simple and function operates with words.
    Once sqWordWrap is fixed, issue should be solved for 1.4.x
    branch. sqBodyWrap code is a little bit more complex and I
    think it operates with bytes. I might need more time to
    understand it and find the way to provide correct word length.

     
  • Tomas Kuliavas

    Tomas Kuliavas - 2005-01-10
    • milestone: 241848 --> 102172
    • assigned_to: nobody --> tokul
     
  • Tomas Kuliavas

    Tomas Kuliavas - 2005-03-27
    • milestone: 102172 -->
    • labels: 102905 -->
     
  • Tomas Kuliavas

    Tomas Kuliavas - 2005-03-27

    Logged In: YES
    user_id=225877

    Issue should be fixed in 1.5.1cvs. functions/strings.php v.1.223

     
  • Tomas Kuliavas

    Tomas Kuliavas - 2005-03-30

    Logged In: YES
    user_id=225877

    There was one more problem with rewrapping in compose.
    Should be fixed in src/compose.php v.1.407.

     
  • Tomas Kuliavas

    Tomas Kuliavas - 2005-07-03
    • assigned_to: tokul --> nobody
     
  • Tomas Kuliavas

    Tomas Kuliavas - 2005-11-06
    • status: open --> closed-fixed
     
  • Tomas Kuliavas

    Tomas Kuliavas - 2005-11-06

    Logged In: YES
    user_id=225877

    fixed in 1.4.6cvs. Fix requires php with mbstring support.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks