Viewed   114 times

I'm forced to work with HTML that looks like this:

<font color=3D=22=236EAED2=22 style=3D=22font-siz=
e:13px;font-family:arial;=22><B>Some Info Here</B></font></=
A></td></tr><tr><td><font color=3D=22=23FFFFFF=22 style=3D=22font-size:11=
px;font-family:arial;=22>192 Wellington Parade =7C Melbourne =7C  VIC =7C=
Australia 3002</font></td></tr><tr><td><font color=3D=22=23FFFFFF=22 st=
yle=3D=22font-size:11px;font-family:arial;=22>T: 61-<a href=3D=22=23=22 s=
tyle=3D=22color:=23FFFFFF; text-decoration:none=22>

It looks like " gets converted to =22 and so on. There is also other "codes" like =7C =3D, = before every new line and so on.

&nbsp; is =26nbsp;

Is there any function or technique for restoring to proper HTML?

Thank you.

 Answers

4

use quoted_printable_decode("YOUR String to decode"); OR imap_qprint("Your String to decode")

Check FIDDLE

Description : quoted_printable_decode — Convert a quoted-printable string to an 8 bit string

his function returns an 8-bit binary string corresponding to the decoded quoted printable string (according to » RFC2045, section 6.7, not » RFC2821, section 4.5.2, so additional periods are not stripped from the beginning of line).

More Info and here too

Friday, August 26, 2022
 
5

Try replacing the echo line with this one:

echo '<label>Forme juridique:</label><input type="text" name="forme_juridique" value="' . htmlspecialchars($data['forme_juridique']).'"><br>';
Monday, November 21, 2022
3

You have to put it anywhere before the code that depends on it is called. Otherwise where you place it won't affect performance.

Many applications typically include files they are dependent on at the top of the file as it makes it easier t keep track of what you're using that way.

Monday, November 7, 2022
 
4

In the first case you should add this before echoing the decoded image data:

header("Content-type: image/gif");

In the second case, use this instead:

echo '<img src="data:image/gif;base64,' . $data . '" />';
Friday, December 2, 2022
 
batuhan
 
3

Check your database connection, make sure the sybase_connect connects with UTF-8 as charset. See http://php.net/manual/en/function.sybase-connect.php

From the comment that you are using ODBC to connect: There seems to be an issue with PHP/ODBC and UTF8. Some suggestions are mentioned in this thread: Php/ODBC encoding problem

Sunday, September 4, 2022
 
dotbill
 
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :