Bug fix - Suggest with utf8 accents éèà

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
araviski
Posts: 14
Joined: Wed Feb 08, 2012 3:18 pm

Bug fix - Suggest with utf8 accents éèà

Post by araviski »

Script URL: I swear I have a licence ! (Private message me if required !)
Version of script: 2.6.5
Hosting company: myself
What terms did you try when SEARCHING for a solution: substr suggest mb_

Write your message below:

In knowledge base auto suggest, when using UTF8 characters such "éèà", if a character stored on multiple bytes is under the cut, this result in question mark like this Image

In order to fix it, in lines 93 and 97 of suggest_articles.php I use mb_substr function instead of substr.

If this fix is correct and if you can add it to next release this would be awesome.

Best regards

Araviski
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Bug fix - Suggest with utf8 accents éèà

Post by Klemen »

This doesn't happen on my server (linux and windows) in any browser I test.

Did you type the article in another software (such as Word) and copy-paste it into HESK?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
araviski
Posts: 14
Joined: Wed Feb 08, 2012 3:18 pm

Re: Bug fix - Suggest with utf8 accents éèà

Post by araviski »

Thank your for your answer.

Accents are well presenting in suggest box 99% of time.

The problem occurs only when the text is cut under the accent character.

Here is a sample case :
http://stackoverflow.com/questions/1244 ... f-8-string
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Bug fix - Suggest with utf8 accents éèà

Post by Klemen »

Thanks for the info, will look into it and fix by checking for and using mb_string function instead if available.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Bug fix - Suggest with utf8 accents éèà

Post by Klemen »

P.s. I still can't replicate it on my test servers to be able to test and confirm the fix.

Could you provide a sample article text that gets truncated like this please?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
araviski
Posts: 14
Joined: Wed Feb 08, 2012 3:18 pm

Re: Bug fix - Suggest with utf8 accents éèà

Post by araviski »

Hello Klemen,

Thank you very much for your help. I have more investigated and problem might come from utf8 text that was migrated from an old version of hesk. I did not succeed to reproduce it with brand new text (I guess a random accent bulk string such ééééééééééé....ééé could made the bug appears, but I did not succeed). Encoding is probably different.

While testing I discovered that html_entities are broken, but the bug is different. I'll try to prepare a fix for this one.
Image
Image

Best regards
Post Reply