TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,236
  • Total Topics: 21,353
  • Online today: 259
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 311
  • Total: 311

Special UTF8 characters not showing correctly in articles (swedish and italian)

Started by spidernik84, February 25, 2011, 03:54:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchBin

Geez.... Server move lost my post... I'll try to take a look at this again soon.

spidernik84

Hello everyone!
Any new development on the UTF8 mystery? :P
I'm still available to try any test you need.
Thank you!

IchBin

Nope I only have so much time in the day I can look at things. And since nobody else seems to want to help with these types of issues, you have to wait on me until I can spend the time to look into it. Sorry.

sturmkatze

Brad, this has been plaguing me on reenactor.Net too. And it also shoots them into weird places like when I make a fake "m" dash like -- or sometimes just in places where there is a space or paragraph return. And it seems that if you remove them, sometimes they don't come back, but the special characters Do go crazy and it ads, sometimes 5-10 characters.

I hope I am not hijacking, but this is JUST what is driving me nuts. And right when I don't have time to look at it :-(

spidernik84

Quote from: IchBin on March 17, 2011, 07:53:41 PM
Nope I only have so much time in the day I can look at things. And since nobody else seems to want to help with these types of issues, you have to wait on me until I can spend the time to look into it. Sorry.
Ok... I'm really sorry not being to help you solve this problem, I feel useless.
I always wanted to become a programmer as well, but I choose the dark side of computer science (I'm an hardware guy: a networking technician).
I'll keep an eye on the thread and update in case I find something.
PS: if anyone is interested in being paid for solving this, just make an offer and I'll be evaluating with my vice-admin :). The solution will be posted here, of course, no need to keep secrets ;).

IchBin

I need to know what your frontpage settings are? What do you have set to display? Articles only, articles and selected forum posts? etc. Depending on which setting you use, changes which code needs to be fixed.

spidernik84


IchBin

Open Sources/TPortalAdmin.php
Code (find) Select
tp_query("UPDATE " . $tp_prefix . "articles SET " . $setting . " = '" . htmlentities($newvalue,ENT_QUOTES) . "' WHERE id='" . $where  . "' LIMIT 1", __FILE__, __LINE__);
Code (Replace with) Select
tp_query("UPDATE " . $tp_prefix . "articles SET " . $setting . " = '" . htmlentities($newvalue,ENT_QUOTES, $context['character_set']) . "' WHERE id='" . $where  . "' LIMIT 1", __FILE__, __LINE__);

Open Sources/TPortal.php
Code (find about line #1594) Select
$row['body'] = html_entity_decode($row['body'],ENT_QUOTES);

Code (Replace) Select
$row['body'] = html_entity_decode($row['body'],ENT_QUOTES, $context['character_set']);


Let me know if that doesn't work for you.

spidernik84

Hi. Sorry for the late delay, I've got no internet at home right now :(.

I think you're almost there, but there's still a few glitches:

1. when editing: the body and the query field are now saving the special characters correctly, but the "title" field does not. This happens after filling the TPAdmin edit article form, saving, and displaying the edit article form again.
2. when showing the article in the frontpage: if I'm saving the article without enabling the intro, the article displays correctly. If I'm using the intro, the article intro and the full article linked to the "read more..." are empty. By this, I do not mean that the page does not display, but that the "article body" is empty.

Ask me if I wasn't clear. Thank you.

IchBin

1. In TPortal.php find this line right next to the other line you edited for the body.
$row['subject'] = html_entity_decode($row['subject']);'

Replace with:
$row['subject'] = html_entity_decode($row['subject'], ENT_QUOTES, $context['character_set']);

2. I cannot reproduce this problem. If I save an article and select to use the intro, the article shows the intro and the read more link. If I then click on the read more link I am taken to the article with the full text from the article. Works as I would expect it to.

This website is proudly hosted on Crocweb Cloud Website Hosting.