Old 17-04-2007, 10:39   #1 (permalink)
stealthcow
knocking heads
 
stealthcow's Avatar
 
Join Date: Jul 2003
Location: London, UK
Posts: 1,905
wordpress being stupid

Wordpress seems to be storing strange characters in the database when I add a post (eg "Women’s Arts International Festival, Cumbria")

When I output it in my custom way, it shows this stupid ’, but when wordpress outputs, it shows it fine - what the hell is it doing?


I've been googling for the past hour or so - it seems that people have been having this problem and its to do with encoding (UTF-8) to be precise. Everyone has been talking about the problem, but noone has given the answer (even after they say they have made it work)

Any help would be appreciated!

Last edited by stealthcow : 27-04-2007 at 07:37.
  Reply With Quote
Old 17-04-2007, 10:44   #2 (permalink)
emil
dt immigrant
 
emil's Avatar
 
Join Date: Nov 2004
Location: Bucharest - Romania
Posts: 6,830
Send a message via ICQ to emil Send a message via MSN to emil Send a message via Yahoo to emil Send a message via Skype™ to emil
__________________
  Reply With Quote
Old 17-04-2007, 11:12   #3 (permalink)
stealthcow
knocking heads
 
stealthcow's Avatar
 
Join Date: Jul 2003
Location: London, UK
Posts: 1,905
that screwed it up even more :|

have a look at the page now!
  Reply With Quote
Old 17-04-2007, 11:18   #4 (permalink)
stealthcow
knocking heads
 
stealthcow's Avatar
 
Join Date: Jul 2003
Location: London, UK
Posts: 1,905
the stupid thing is that it shows fine in the wordpress admin and the wordpress front end, but not in the DB - so what is wordpress doing that im not?
  Reply With Quote
Old 17-04-2007, 11:41   #5 (permalink)
steveb
389 ppm and rising
 
steveb's Avatar
 
Join Date: Aug 2005
Location: Järvenpää, Finland
Posts: 4,522
Can you open up the file in MetaPad and search/replace incidences of the offending apostrophes with the relevant code, e.g. ’ = & # 8 2 1 7 ;

Then it can't help but display properly.
  Reply With Quote
Old 17-04-2007, 11:47   #6 (permalink)
stealthcow
knocking heads
 
stealthcow's Avatar
 
Join Date: Jul 2003
Location: London, UK
Posts: 1,905
i could, but that would take a loooong time (ive just installed wordpress with our custom frontends on about 5 sites and got people to input the content, we only noticed after it was too late), so i need a solution that could be done in PHP by processing the output, could do a search replace using PHP but that'll become server heavy pretty quickly
  Reply With Quote
Old 17-04-2007, 11:50   #7 (permalink)
steveb
389 ppm and rising
 
steveb's Avatar
 
Join Date: Aug 2005
Location: Järvenpää, Finland
Posts: 4,522
I take your point!

You'd think by 2007 it would be possible to display basic punctuation. But noooo.
  Reply With Quote
Old 17-04-2007, 12:26   #8 (permalink)
stealthcow
knocking heads
 
stealthcow's Avatar
 
Join Date: Jul 2003
Location: London, UK
Posts: 1,905
any more ideas?
  Reply With Quote
Old 17-04-2007, 13:44   #9 (permalink)
steharg
Senior Member
 
steharg's Avatar
 
Join Date: Sep 2006
Location: Liverpool
Posts: 240
give them a ring and see if they'll rename the festival so its compatible with wordpress, or just call it WAIF
  Reply With Quote
Old 18-04-2007, 05:07   #10 (permalink)
stealthcow
knocking heads
 
stealthcow's Avatar
 
Join Date: Jul 2003
Location: London, UK
Posts: 1,905
great help... anyone else?
  Reply With Quote
Old 18-04-2007, 09:42   #11 (permalink)
stealthcow
knocking heads
 
stealthcow's Avatar
 
Join Date: Jul 2003
Location: London, UK
Posts: 1,905
fixed it...

<?php
header('Content-Type: text/html; charset=utf-8');
?>

at the top of every page, kushti
  Reply With Quote
Old 18-04-2007, 09:49   #12 (permalink)
steveb
389 ppm and rising
 
steveb's Avatar
 
Join Date: Aug 2005
Location: Järvenpää, Finland
Posts: 4,522
Well done and thanks for not keeping the solution a secret.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8