Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Replace special chars
Old 02-05-2006, 02:52 PM Replace special chars
Average Talker

Posts: 26
Location: the Netherlands
Trades: 0
Hey,

I've been busy with some RSS feeds, to read this feeds into another website.
But I've got a problem while displaying the information.
All the special chars, like ï and ë and ö and that stuf, are replaced with some weird chars.
How do i display this chars correctly?

I thought replacing them to HTML code would be an option, but there are so much of this special chars!
Maybe there is an function to show these special chars correctly?

Thanks in advance!

Peter Bosch
__________________

Please login or register to view this content. Registration is FREE
PeterB is offline
Reply With Quote
View Public Profile Visit PeterB's homepage!
 
 
Register now for full access!
Old 02-05-2006, 03:37 PM Re: Replace special chars
neroux's Avatar
Ultra Talker

Posts: 284
Trades: 0
I might be wrong, but I suppose you are looking for htmlentities().
__________________

Please login or register to view this content. Registration is FREE
- The world at your fingertips
• Share your city with the world

--
Please login or register to view this content. Registration is FREE
neroux is offline
Reply With Quote
View Public Profile
 
Old 02-06-2006, 07:23 AM Re: Replace special chars
Average Talker

Posts: 26
Location: the Netherlands
Trades: 0
Thnx, but I've tried this one.
I also tried get_html_translation_table() but it wouldn't work neither..
__________________

Please login or register to view this content. Registration is FREE
PeterB is offline
Reply With Quote
View Public Profile Visit PeterB's homepage!
 
Old 02-06-2006, 07:35 AM Re: Replace special chars
neroux's Avatar
Ultra Talker

Posts: 284
Trades: 0
Can you post your code and explain what you want it to do and what it is doing instead ?
__________________

Please login or register to view this content. Registration is FREE
- The world at your fingertips
• Share your city with the world

--
Please login or register to view this content. Registration is FREE
neroux is offline
Reply With Quote
View Public Profile
 
Old 02-06-2006, 11:57 AM Re: Replace special chars
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
basically you need the correct character set meta declaring so the browser "knows" what to use.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-07-2006, 11:00 AM Re: Replace special chars
Average Talker

Posts: 26
Location: the Netherlands
Trades: 0
I use this code at the moment:

PHP Code:
htmlentities( ${$name}[ 'title' ][ $a ] ) 
Special characters, like ï, are not replaced by using htmlentities.
Instead of the ï the browsers puts out a very strange thing: ï

I've already tried to set the character settings on Unicode UTF-8, but when I use that the page wouldn't load correctly.
__________________

Please login or register to view this content. Registration is FREE
PeterB is offline
Reply With Quote
View Public Profile Visit PeterB's homepage!
 
Old 02-07-2006, 11:24 AM Re: Replace special chars
neroux's Avatar
Ultra Talker

Posts: 284
Trades: 0
htmlentities() converts ï into &iuml;. So I guess ${$name}[ 'title' ][ $a ] does not contain the right value.

Please post the full code.
__________________

Please login or register to view this content. Registration is FREE
- The world at your fingertips
• Share your city with the world

--
Please login or register to view this content. Registration is FREE
neroux is offline
Reply With Quote
View Public Profile
 
Old 02-08-2006, 04:53 PM Re: Replace special chars
Average Talker

Posts: 26
Location: the Netherlands
Trades: 0
Hmm, I've tried a bit with htmlentities and it works, but not without problems.

Some feeds are encoded ISO-8859-1 and others are encoded UTF-8.
At the feeds with encoding ISO-8859-1 there are no problems, but at the feeds which use UTF-8 it won't work :S.

Anyone knows how to display the feeds with UTF-8 encoding correctly?
__________________

Please login or register to view this content. Registration is FREE
PeterB is offline
Reply With Quote
View Public Profile Visit PeterB's homepage!
 
Reply     « Reply to Replace special chars
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20420 seconds with 12 queries