By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,282 Members | 1,548 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,282 IT Pros & Developers. It's quick & easy.

Special characters pulled from wordpress database

P: n/a
Hello,

I'm developing a site that makes use of wordpress. The homepage is
outside of wordpress and I am pulling the latest 3 blog posts from the
wordpress database to display on the homepage. The problem is that
special characters (—) for example, do not display properly. It
displays as a "?" with a diamond around it �. The characters actually
display fine withing the wordpress blog portion of the site.

I tried changing the encoding on the homepage to UTF-8 (wordpress uses
this), but no luck. Any ideas?

Thank You
Jan 28 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I tried changing the encoding on the homepage to UTF-8 (wordpress uses
this), but no luck. Any ideas?
What does your browser say the encoding is?

Did you try to save a string from the database to a text file?

If the browser says it is utf-8, and the text file shows question marks
(even in a hexdump), it may be the connection library that generates the
question marks.

Good luck,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Jan 28 '08 #2

P: n/a
On Jan 28, 9:03 am, Willem Bogaerts
<w.bogae...@kratz.maardanzonderditstuk.nlwrote:
I tried changing the encoding on the homepage to UTF-8 (wordpress uses
this), but no luck. Any ideas?

What does your browser say the encoding is?

Did you try to save a string from the database to a text file?

If the browser says it is utf-8, and the text file shows question marks
(even in a hexdump), it may be the connection library that generates the
question marks.

Good luck,
--
Willem Bogaerts

Application smith
Kratz B.V.http://www.kratz.nl/
Strange. My browser (firefox) was set to UTF-8 encoding. I set it to
ISO-8859-1 and the mdashes display fine. If I change the encoding in
the header of the web page to UTF-8, and then try to view with the
browser set to UTF-8, I still see the nonsense character. Any ideas on
why this won't work with UTF-8. The header of the Wordpress page shows
UTF-8, and everything displayes fine with the browser set to UTF-8.

Thanks,
Jan 28 '08 #3

P: n/a
On Jan 28, 1:46 pm, sleepy1038 <clar...@gmail.comwrote:
On Jan 28, 9:03 am, Willem Bogaerts

<w.bogae...@kratz.maardanzonderditstuk.nlwrote:
I tried changing the encoding on the homepage to UTF-8 (wordpress uses
this), but no luck. Any ideas?
What does your browser say the encoding is?
Did you try to save a string from the database to a text file?
If the browser says it is utf-8, and the text file shows question marks
(even in a hexdump), it may be the connection library that generates the
question marks.
Good luck,
--
Willem Bogaerts
Application smith
Kratz B.V.http://www.kratz.nl/

Strange. My browser (firefox) was set to UTF-8 encoding. I set it to
ISO-8859-1 and the mdashes display fine. If I change the encoding in
the header of the web page to UTF-8, and then try to view with the
browser set to UTF-8, I still see the nonsense character. Any ideas on
why this won't work with UTF-8. The header of the Wordpress page shows
UTF-8, and everything displayes fine with the browser set to UTF-8.

Thanks,
Any other ideas on this issue. Since my last post, I tried using
utf8_encode on the string pulled from the database. This method
actually strips out the special characters entirely!! I'm at a loss.
Feb 1 '08 #4

P: n/a
NC
On Jan 28, 5:39 am, sleepy1038 <clar...@gmail.comwrote:
>
I'm developing a site that makes use of wordpress. The
homepage is outside of wordpress
Bad idea... There's no reason for it to be outside of
WordPress...
and I am pulling the latest 3 blog posts from the wordpress
database to display on the homepage. The problem is that
special characters (&mdash;) for example, do not display
properly.
....
I tried changing the encoding on the homepage to UTF-8
(wordpress uses this), but no luck. Any ideas?
Reimplement the home page as a WordPress Page; write a plugin to
extract and display the last three blog posts and use it on the
home page.

Cheers,
NC
Feb 2 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.