HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Russian letters issue in a side_shoutbox

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#101299 (In Topic #19869)
Avatar

Well-settled

text lines break at certain characters

I have tried to move shoutbox to the site's main content area by users request. It can be seen here: http://bfed2.diablomods.ru/site/index.php?page=start
However, if people try to post messages in russian it breaks strings at certain characters (like "а", "и", "н" and so on) replacing characters with weird symbol. When I post the same messages in Chat Lobby nothing is broken. It breakes messages themselves, not just output - messages are saved broken and display like that in moderation area. I have deleted all broken messages from my shoutbox but can post more if it will help to understand the issue source.

Will be very grateful for any help :)
Back to the top
 
Posted
Rating:
#101300
Avatar

Hi :),

In the BLOCK_SIDE_SHOUTBOX_MESSAGE template change {$TRUNCATE_LEFT,{MESSAGE},92,1,1} to {MESSAGE} – this is a workaround. It seems our truncation code is not unicode aware, which is a surprise to me as I think I remember making it unicode aware. It might be that it created a performance problem and we had to revert it, I will get back to you on this.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#101301
Avatar

Well-settled

Thank you Chris but unfortunately it doesn't work :( I have replaced this code even before go question here and it still wraps words. Moreover, it stores them wrapped in database, not just display like that. So they are wrapped even in the admin area when I moderate chat rooms.

It does not happen though when I post to chat room instead of shoutbox. They definitely should have a different message storing mechanics which play the key role in my issue :) Is it possible to apply storing mechanics from Chat Lobby to Shoutbox? I hope it would solve my problem completely.
Back to the top
 
Posted
Rating:
#101302
Avatar

Hmm, I didn't read what you said properly did I ;). I'll get back to you.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#101339
Avatar

Hi,

I've had a better look now.

Truncation does have a problem, and I believe we're fixing that in v10 because it involves a lot of changes.

However, your main problem is the shoutbox has a hard-coded wrapping size of 15 characters, but it's not unicode-aware. Each Russian character is 2-bytes, so it's cutting at 7.5 unicode characters.

I'm about to post a hotfix that will double word-wrap position if unicode is on, and also stop it being able to wrap mid-character.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Important!
Posted
Rating:
#101340
Avatar

Automated fix message

raven said

I have tried to move shoutbox to the site's main content area by users request. It can be seen here: http://bfed2.diablomods.ru/site/index.php?page=start
However, if people try to post messages in russian it breaks strings at certain characters (like "а", "и", "н" and so on) replacing characters with weird symbol. When I post the same messages in Chat Lobby nothing is broken. It breakes messages themselves, not just output - messages are saved broken and display like that in moderation area. I have deleted all broken messages from my shoutbox but can post more if it will help to understand the issue source.

Will be very grateful for any help :)
This issue has been filed on the tracker as issue #1453, with a fix.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Important!
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: