vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Help with wrong characters being displayed (https://vborg.vbsupport.ru/showthread.php?t=316942)

Paddy Murphy 01-26-2015 04:58 PM

Help with wrong characters being displayed
 
Hi,

I have numerous characters coming through to my forum via RSS Feed Manager that are wrong.

For example;

' comes through as ' (I actually fixed this one by placing ' in the Replacement Variables)

But please help with these;

£ comes through as ?
“£ comes through as ??
“ comes through as ?

They're just ones I've noticed.

Is there a work around for this issue?

Thank you

Lynne 01-26-2015 05:23 PM

If you look at the feed and see the page source, is there an encoding listed? And is it the same encoding used on your site?

Paddy Murphy 01-26-2015 06:54 PM

Hi Lynne,

Thanks for the reply.

I went into great detail about this issue on the vBulletin forum here.

Would you mind taking a look there to see the issues I've been having please? I hope it will give you a better insight to my issue, if not please let me know what other information you need. I've since gotten new Google Alert Feed url's.

Here's one for example - https://www.google.ie/alerts/feeds/0...23403621179732

I'm then putting these feeds through feedburner and they are being posted here on my forum.

Regards

Lynne 01-26-2015 10:15 PM

My 4.2.2 forum doesn't like that feed at all. I then went to the google alerts page and got a new RSS feed URL, and my site doesn't like it either. So, it may just be that those feeds can't be read by vbulletin.

Paddy Murphy 01-26-2015 11:08 PM

I don't use that feed directly. I put that feed through feedburner to give me this - http://feeds.feedburner.com/GoogleAlert-Cannabis

I just noticed, the error characters in this link (shown as squares) are the ones that are showing on my forum as ? (a question mark).

Lynne 01-27-2015 04:54 PM

So it isn't just the characters from the feed showing up wrong, it is those particular characters being used anywhere on your site that are showing up wrong?

In Language Manager > edit main language > what is your Language Code and HTML Character Set?

And in MySQL, what is the collation of the vbulletin tables?

Paddy Murphy 01-27-2015 05:29 PM

Well in this feed that I'm using for example (http://feeds.feedburner.com/GoogleAlert-Cannabis) some characters like the € (Euro symbol) is shown as a square. And when it then gets posted to my forum via RSS manager, the square is displayed as a ? (question mark). This happens with other characters to like " also.

Language Code = en

HTML Character Set = ISO-8859-1

In phpMyAdmin most of my database tables are set to latin1_swedish_ci

I changed some of the tables (post, thread etc) to utf8_general_ci to see if this would fix the issue but it did not.

Lynne 01-27-2015 11:12 PM

If it is showing incorrectly in the feed, then it certainly isn't going to correct itself in a post on your forum.

I would strongly recommend NOT mixing your table collations like that. You are going to cause yourself problems (not to mention that for utf8_general_ci, it is best to have the HTML Character Set be UTF-8).

Paddy Murphy 01-28-2015 10:39 AM

Quote:

Originally Posted by Lynne (Post 2534915)
If it is showing incorrectly in the feed, then it certainly isn't going to correct itself in a post on your forum.

Ok. I think it's time to seek an alternative to Google Alerts. If I use the Google Alert (https://www.google.ie/alerts/feeds/0...98089616524864) directly I get this error;

Code:

XML Error: not well-formed (invalid token) at line 1
Quote:

Originally Posted by Lynne (Post 2534915)
I would strongly recommend NOT mixing your table collations like that. You are going to cause yourself problems (not to mention that for utf8_general_ci, it is best to have the HTML Character Set be UTF-8).

Ok. How do I change them all to utf8_general_ci ?

Thanks

Lynne 01-28-2015 10:47 PM

I thought you had already changed some table collations?

Step 6 here explains it - http://www.vbulletin.com/forum/forum...ight=collation

NOTE: It is very very very important to make full database backups before proceeding if you are ever manually making any changes to your database.

Paddy Murphy 01-29-2015 11:42 PM

Yes I've changed about 20 of the tables. But there's over 200 more, I'd prefer not to do each one by one. Is there a way I can change all the tales in one go? A query ?

I know how to back up my forum database :-)

Lynne 01-30-2015 06:48 PM

I would think you would need to write a script if you want to do all the tables in one go.

Paddy Murphy 02-01-2015 02:42 PM

Quote:

Originally Posted by Lynne (Post 2535310)
I would think you would need to write a script if you want to do all the tables in one go.

Ok. Is there a guide to do that?

ozzy47 02-01-2015 02:57 PM

If you know PHP programming, you should be able to knock something up.

Paddy Murphy 02-01-2015 06:47 PM

Quote:

Originally Posted by ozzy47 (Post 2535530)
If you know PHP programming, you should be able to knock something up.

I don't. Can you point me to some guide or information on doing this please?

Lynne 02-01-2015 06:59 PM

You want a guide on how to write PHP code? I love w3schools for reference.

http://www.w3schools.com/php/default.asp

Paddy Murphy 02-08-2015 06:40 PM

1 Attachment(s)
Ok, all my database tables are now set to utf8_general_ci

I thought this would solve my problem but it has not.

When I set the HTML Character Set to UTF-8 I get squares for some of the characters (see attachment)

When I set the HTML Character Set to ISO-8859-1 I get � for some of the characters (see attachment)

See attachment for original characters in source article.

kh99 02-08-2015 06:46 PM

What are you using now for a feed? I tried a couple of the links you posted earlier but they didn't seem to be working.

Paddy Murphy 02-08-2015 07:22 PM

Quote:

Originally Posted by kh99 (Post 2536678)
What are you using now for a feed? I tried a couple of the links you posted earlier but they didn't seem to be working.

Hi,

http://feeds.feedburner.com/google/qYjc

Thanks

kh99 02-08-2015 07:30 PM

Quote:

Originally Posted by Paddy Murphy (Post 2536687)

Hmm...for some reason that seems to post only the article titles with a "More..." link, and all the titles seem to look OK.

Paddy Murphy 02-08-2015 08:10 PM

I'm using;

Code:

{feed:content:encoded}

Click here to read the full story...

For the Body Template.

I should point out that's not just feeds I having this issue with. Since I changed the HTML Character Set to UTF-8 from ISO-8859-1 it is also effecting usernames that contain a ?

See - http://www.forum.norml.ie/member.php?11

The username should be Ois?n Mac Giolla Bhr?de but it is being displayed as Ois�n Mac Giolla Bhr�de

kh99 02-08-2015 08:28 PM

OK, well, the only problem I saw in that feed is "It& # 39;s" that's supposed to be "It's". But when I look at the feed xml I see this:
Code:

It's time to reconsider the regulation of marijuana and <b>hemp</b>.
An if you imagine decoding the characters, the &lt;b&gt;hemp&lt;/b&gt; later in the line becomes <b>hemp</b>, which correctly makes the word hemp bold in the post. But if you decode It&amp;#39;s you get It& # 39;s, which is what you see in the post. So it seems to me it's a problem in the feed, and I don't really see a solution to it (well, except maybe if you hacked the code to decode the post twice, but I'm not sure that wouldn't cause other issues).

Edit: BTW, I added some spaces in the above to prevent the codes from being interpreted.

Paddy Murphy 02-08-2015 08:48 PM

I was able to fix the apostrophe issue with a replacement variable - https://vborg.vbsupport.ru/external/2015/02/16.jpg

I don't mind the bold words so much. It's the ? & ? characters being displayed as boxes that I'd like to sort out.

kh99 02-08-2015 09:30 PM

Oh, OK, sorry. I remember seeing something earlier about replacement variables but I didn't pay enough attention.

I looked in to the other issue a little when you posted on vbulletin.com and I found that the feed seemed to be an ISO-8859-1 encoded document, with an xml tag that said it was UTF-8, and I think the rss feed poster code wasn't prepared to handle that. I would look in to it more but I didn't see those chars in the feed I was looking at.

Lynne 02-08-2015 10:32 PM

Try changing this in your config.php file and uncomment this line.

PHP Code:

// $config['Mysqli']['charset'] = 'utf8'; 

so it looks like:
PHP Code:

$config['Mysqli']['charset'] = 'utf8'


Paddy Murphy 02-13-2015 10:59 PM

ozzy47, kh99 & Lynne thank you very much for your help with this issue.

I'm not sure why but for the last 4/5 days everything seems to be running smoothly. Maybe the database took a day or two to recognise the that the tables were changed to utf8_general_ci. So feeds are good.

The characters in the usernames were ok after I edited them from the box to the correct character.

Thanks again :)

ozzy47 02-14-2015 12:30 AM

Well glad to hear all is well now. :)


All times are GMT. The time now is 02:14 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01908 seconds
  • Memory Usage 1,799KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (27)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete