Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
2 registered (SteveS, JPFolks), 34 Guests and 14 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 05/10/05
Posts: 1
Top Posters (30 Days)
Ruben 49
DennyP 24
Gizmo 23
Dunny 17
SteveS 14
AllenAyres 12
dbremer 10
SD 9
drkknght00 9
driv 8
Latest Photos
OK Corral Shoot Out
Testing
Basildon Train Station
Basildon Town Centre looking from the rounderbout
Basildon Town Square
Topic Options
#172832 - 01/09/07 09:12 AM Importing a UBB.classic forum that uses UTF-8
James Thomson Offline
stranger
Registered: 01/09/07
Posts: 5
Loc: Glasgow, Scotland
I have a UBB.classic forum here which uses UTF-8 as the character set.

I'm trying to import this into UBB.threads 7.0.2 using the classic_import script, but all the non-ASCII characters in the posts are being mangled. The MySQL database is set to use UTF-8, and any new posts I make appear to be stored correctly.

How can I convince the importer to insert the posts as UTF-8?

Thanks!
Top
Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
#172842 - 01/09/07 11:01 AM Re: Importing a UBB.classic forum that uses UTF-8 [Re: James Thomson]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
You'll probably need to edit the classic_import.php script. Around line 68 of the script you'll see the header section it spits out for the page. You can add this to it and it *should* do the trick:

<meta http-equiv="Content-Type" content="text/html; charset="UTF-8" />
Top
#172862 - 01/09/07 07:08 PM Re: Importing a UBB.classic forum that uses UTF-8 [Re: Rick]
James Thomson Offline
stranger
Registered: 01/09/07
Posts: 5
Loc: Glasgow, Scotland
I was very hopeful - it appeared to do the right thing while importing - the post subjects displayed correctly as they went past which they didn't before - but, sadly, when I went to the forum, the posts were still mangled.

I think that patch fixed the display output of the importer, but not the actual import.

Any other ideas?
Top
#172863 - 01/09/07 07:15 PM Re: Importing a UBB.classic forum that uses UTF-8 [Re: James Thomson]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
You might need to change the language encoding in the generic.php language file to UTF-8 as well.

A good way to test if it actually imported the data correctly is if you have something like phpmyadmin installed on the server. This would allow you to look at the database directly, specifically the ubbt_POSTS table to see if it's an import issue or if it's a display issue.
Top
#172864 - 01/09/07 07:39 PM Re: Importing a UBB.classic forum that uses UTF-8 [Re: Rick]
James Thomson Offline
stranger
Registered: 01/09/07
Posts: 5
Loc: Glasgow, Scotland
I checked with phpmyadmin, and the data is definitely wrong in the table, so I think it is an import issue. New posts with non-ASCII characters in them work fine, and it looks like the data is being correctly stored in the database as unicode in those cases.

* however *

Changing the generic.php to UTF-8 causes the older posts to display correctly. But I'm a little wary of leaving it like that with incorrect data in the database - it feels a bit like we're sweeping the problem under the carpet \:\)
Top
#172866 - 01/09/07 07:59 PM Re: Importing a UBB.classic forum that uses UTF-8 [Re: James Thomson]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
I think as long as it's displaying some of the special characters correctly then it's probably ok. The big thing would be to check a post that is showing improperly in the db, and looking at it in the script to see if it's displaying those characters properly. If it is, and you can edit the post as well, without any issues, then you're probably safe.

You could possibly try changing the charset that MySQL uses before the import is done, as I believe it uses latin1 as the default, but if old posts are displaying properly and new posts are ok, then you might not need to go that route.
Top
#172875 - 01/09/07 08:29 PM Re: Importing a UBB.classic forum that uses UTF-8 [Re: Rick]
James Thomson Offline
stranger
Registered: 01/09/07
Posts: 5
Loc: Glasgow, Scotland
Things seem to be functioning ok, I'll go with this solution for now. Thanks!
Top



Moderator:  AllenAyres, Harold, Ian, Ron M 
Shout Box

Today's Birthdays
No Birthdays
Recent Topics
Ability to "like" individual posts (not Facebook "likes)
by doug
05/23/12 09:03 AM
Island Permissions
by ThreadsUser
05/22/12 03:03 PM
streaming video
by prkrgrp
05/20/12 07:02 PM
New Posts Corrupted? Can someone help?
by PianoWorld
05/19/12 09:41 AM
Custom forum permissions
by ntdoc
05/18/12 02:07 PM
Forum Stats
10489 Members
36 Forums
33841 Topics
181697 Posts

Max Online: 978 @ 06/24/07 11:19 PM
Random Image