Author Topic: Twitter protocol - special characters not displaying properly  (Read 939 times)

0 Members and 1 Guest are viewing this topic.

Offline omniwolfTopic starter

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Hi again

Recently i've noticed that the twitter client is not displaying "<" or ">" correctly in the twitter feed.  instead it displays "&lt;" or "&gt;".
This happened previously with the "&" character, and when i was maintaining the protocol i had to "fix" this as you can see here:

https://github.com/miranda-ng/miranda-ng/blob/master/protocols/Twitter/src/twitter.cpp#L243

and here:

https://github.com/miranda-ng/miranda-ng/blob/master/protocols/Twitter/src/twitter.cpp#L252


So you'd have to put somewhere around line 263 (above the push_back(u) call):

Code: [Select]
// ok here i'm trying some way to fix all the "&gt;" and "&lt;" things that are showing up
// i dunno why it's happening, so i'll just find and replace each occurance :/
std::string rawText = u.status.text;
for (size_t pos = 0; (pos = rawText.find("&lt;", pos)) != std::string::npos; pos++)
rawText.replace(pos, 4, "<");

for (size_t pos = 0; (pos = rawText.find("&gt;", pos)) != std::string::npos; pos++)
rawText.replace(pos, 4, ">");

u.status.text = rawText;
 

Offline Robyer

I was developing mainly Facebook, Omegle, Steam, Dummy and MobileState plugins. Now I'm retired. Goodbye, everyone. ~ You can still find me on Facebook.
 

Offline omniwolfTopic starter

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
much neater, thank you :)