Twitter uses wrong encoding when remove urls is ticked

Bug #1412510 reported by Dan Garner
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Xibo
Fix Released
Undecided
Dan Garner

Bug Description

Something goes wrong with Twitter in the parsing of special characters like apostrophes, ' turns into â as seen in this example:

"Good students of @KaiminNews & @UMJSchool, enjoy winter break. I’m going to make your brain hurt starting next week. http://www.ronreason.com/pollner/ "

turns into:

"Good students of @KaiminNews & @UMJSchool, enjoy winter break. I’m going to make your brain hurt starting next week."

I'm not sure if this an issue in the character encoding used or what might be causing this, but it definitely looks bad.

Dan Garner (dangarner)
Changed in xibo:
milestone: none → 1.7.0
assignee: nobody → Dan Garner (dangarner)
Revision history for this message
Dan Garner (dangarner) wrote :

can you try replacing the following line in modules/twitter.module.php ?

Line 829:
$tweetText = preg_replace("@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@", '', $tweet->text);

becomes

$tweetText = preg_replace("@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@u", '', $tweet->text);

Revision history for this message
markuhde (mark-markuhde) wrote :

That seems to fix the apostrophes but there is still some odd behaviour:

RT @mtpublicradio: Find #Montana Legislature coverage from MTPR, YPR and @UMJSchool here http://t.co/m5t62B1gBE #mtleg http://t.co/Tj5IzwTm

Becomes:

RT @mtpublicradio: Find #Montana Legislature coverage from MTPR, YPR and @UMJSchool here #mtleg €¦

It seems to me that the "¦" isn't necessarily ideal to add.

Dan Garner (dangarner)
Changed in xibo:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.