Jump to content


Photo

Decode special characters


  • Please log in to reply
10 replies to this topic

#1 pkrtech

pkrtech
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 02 September 2006 - 03:22 PM

And I cannot get them to be converted to HTM unless I use eregi_replace

can anyone tell me how to ?  Here is what I cant find a function to convert automatically.

I have been using urldecode()  as well as htmlentities_decode  but as I am going through more text this weird crap keeps popping up. Is there something I am missing ? Or do I have to manually eregi_replace each on that pops up ?

'

â??

Source = …  showing through html = … 

'

"

Source  =  »      showing through html = » 


There is alot more variations I am finding. any ideas ?



#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 02 September 2006 - 03:26 PM

Dont get it do you encode the words and the words come out funny looking ?

or are the words going into the database in a funny looking way?
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 w32

w32
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 02 September 2006 - 03:30 PM

question, are those special characters in your php code, or are they in html bits. If in the html bits they should render just fine...and if they are in your php coding why would you be using special chars there??

I am confused..

#4 pkrtech

pkrtech
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 02 September 2006 - 03:41 PM

ok lets take this for instance this is what my data shows after I encoded and sitting in the DB

Microsoftâ??s

thats what the pure html is however I would assume that is just a ' or something similar but on the actual page shows

Microsoftâ??s



#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 02 September 2006 - 03:44 PM

How do you encode your html, prehaps it could be a charset issue. Post an example here of how you ecode your html/text.

#6 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 02 September 2006 - 03:45 PM

what method are you encoding information please .

give us an example
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#7 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 02 September 2006 - 03:46 PM

what method are you encoding information please .

give us an example

Why have you posted what I basically just said?

#8 pkrtech

pkrtech
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 02 September 2006 - 03:49 PM

I just run all the data through

htmlentities(data, ENT_QUOTES);

and

urlencode($data);


#9 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 02 September 2006 - 03:52 PM

Use html_entity_decode when you have converted HTML special characters into thier html enitity equivalent. urldecode is for decoding encoded url strings with the urlencode function.

#10 pkrtech

pkrtech
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 02 September 2006 - 03:58 PM

Im aware of that, doesnt work for the characters I provided. 99% of the characters it works just some that pops up. I already have 13 eregi_replace statements its getting out of hand.

#11 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 02 September 2006 - 04:05 PM

Are you using urlencode and htmlentities together? Remove urlencode. As that could be the problem. Just use htmlenties to convert the html characters to their html entity equivilant. Also post your actuall code here too. SO I can see how your script process the data.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users