|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Enthusiast
![]() Join Date: Feb 2006
Posts: 60
|
Good day to you all,
I'm working on a script which take the text from a txt file and add his content to an php page. I have no problem with that part, see code below : PHP Code:
This page can include <b> <u>... html element. Where my problem start is that it's possible that I get some : PHP Code:
Thanks! |
|
|
|
|
|
#2 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Oct 2009
Posts: 480
|
Why do you need this? These elements should be displayed correctly.
What encoding do you use? Are there only one encopding (language) on the page? |
|
|
|
|
|
#4 |
|
SitePoint Enthusiast
![]() Join Date: Feb 2006
Posts: 60
|
yes you are right, I'm talking about them :
é ê ... |
|
|
|
|
|
#5 |
|
SitePoint Enthusiast
![]() Join Date: Feb 2006
Posts: 60
|
Anthony,
can I do something like : PHP Code:
|
|
|
|
|
|
#6 |
|
Previously, SilverBulletUK.
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Apr 2008
Location: North-East, UK.
Posts: 2,921
|
Sure.
|
|
|
|
|
|
#7 |
|
SitePoint Enthusiast
![]() Join Date: Feb 2006
Posts: 60
|
Here is what i'm now working but I'm getting an error:
syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' PHP Code:
|
|
|
|
|
|
#8 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Oct 2009
Posts: 480
|
You're on the wrong way.
No need to replace it at all |
|
|
|
|
|
#9 |
|
SitePoint Enthusiast
![]() Join Date: Feb 2006
Posts: 60
|
why ?
|
|
|
|
|
|
#10 |
|
SitePoint Enthusiast
![]() Join Date: Feb 2006
Posts: 60
|
I don't understand, it won't change the other no?
|
|
|
|
|
|
#11 |
|
SitePoint Enthusiast
![]() Join Date: Feb 2006
Posts: 60
|
Nice I got it working !!!
Thanks! Is there a way to make that an external script that I load each time I need ? |
|
|
|
|
|
#12 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Oct 2009
Posts: 480
|
Why do you need this replace?
Why don't just output text as is? What's the problem? |
|
|
|
|
|
#13 |
|
SitePoint Mentor
![]() ![]() Join Date: Sep 2005
Location: Sydney, NSW, Australia
Posts: 9,629
|
|
|
|
|
|
|
#14 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Oct 2009
Posts: 480
|
That's nonsense!
Do you see it here as "?" in your browser? We're in the 21th century. Every browser in the world can display any encoding, even japanese Shift-JIS with no problem If it was properly set in HTTP header The only reason for replace is if you have two single-byte encodings on one page. But in this case you must use UTF for sure. |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 11:39.












Linear Mode
