Special characters pulled from wordpress database
Special characters pulled from wordpress database
am 28.01.2008 14:39:39 von sleepy1038
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 ï¿=BD. The characters actuall=
y
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
Re: Special characters pulled from wordpress database
am 28.01.2008 14:52:24 von Jensen Somers
sleepy1038 wrote:
> 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
Did you try to pass them through htmlentities() or htmlspecialchars()?
- Jensen
Re: Special characters pulled from wordpress database
am 28.01.2008 15:03:52 von Willem Bogaerts
> 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/
Re: Special characters pulled from wordpress database
am 28.01.2008 15:58:31 von Kailash Nadh
On Jan 28, 1:39 pm, sleepy1038 wrote:
> 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 ï¿=BD. The characters actua=
lly
> 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
If you are passing your content through htmlentities(), that might be
the problem.
--
Kailash Nadh | http://kailashnadh.name
Re: Special characters pulled from wordpress database
am 28.01.2008 19:41:10 von sleepy1038
I tried using both these functions before, but no luck.
On Jan 28, 8:52 am, Jensen Somers wrote:
> sleepy1038 wrote:
> > 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 ï¿=BD. The characters act=
ually
> > 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
>
> Did you try to pass them through htmlentities() or htmlspecialchars()?
>
> - Jensen
Re: Special characters pulled from wordpress database
am 28.01.2008 19:46:11 von sleepy1038
On Jan 28, 9:03 am, Willem Bogaerts
wrote:
> > 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,
Re: Special characters pulled from wordpress database
am 01.02.2008 16:52:14 von sleepy1038
On Jan 28, 1:46 pm, sleepy1038 wrote:
> On Jan 28, 9:03 am, Willem Bogaerts
>
>
>
> wrote:
> > > 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.