[PATCH] Add MacRoman encoding to htmlentities

php.internals

Marcus Bointon

22 years ago
Hi, Attached is a patch against 5.0.0b2 for ext/standard/html.c that adds support for the MacRoman encoding to the htmlentities function. I guess it may also be used by html_decode_entities too. It will require further attention as I don't quite get what I need to do in html escape and unescape functions, but it includes the hard bit which is the actual translation table. With the rise of MacOS X, the lack of MacRoman encoding in PHP is a bit of a pain as it's the default encoding on there. I also posted a PHP function in a user comment on htmlentities that performs this conversion, but it would obviously be better to have this done internally. I hope someone can finish this off properly as C is not my thing. Thanks, Marcus
-- Marcus Bointon Synchromedia Limited: Putting you in the picture marcus@synchromedia.co.uk | http://www.synchromedia.co.uk

Marcus Bointon

22 years ago
Ahem, and again, with the attachment... on 21/11/03 14:45, Marcus Bointon at marcus@synchromedia.co.uk wrote:
> Hi, > > Attached is a patch against 5.0.0b2 for ext/standard/html.c that adds > support for the MacRoman encoding to the htmlentities function. I guess it > may also be used by html_decode_entities too. > > It will require further attention as I don't quite get what I need to do in > html escape and unescape functions, but it includes the hard bit which is > the actual translation table. > > With the rise of MacOS X, the lack of MacRoman encoding in PHP is a bit of a > pain as it's the default encoding on there. I also posted a PHP function in > a user comment on htmlentities that performs this conversion, but it would > obviously be better to have this done internally. > > I hope someone can finish this off properly as C is not my thing. > > Thanks, > > Marcus
-- Marcus Bointon Synchromedia Limited: Putting you in the picture marcus@synchromedia.co.uk | http://www.synchromedia.co.uk

Marcus Bointon

22 years ago
on 21/11/03 14:46, Marcus Bointon at marcus@synchromedia.co.uk wrote:
> Ahem, and again, with the attachment...
Erm. That didn't come through to the list - how/where am I supposed to post patches as I have seen others do? Marcus
-- Marcus Bointon Synchromedia Limited: Putting you in the picture marcus@synchromedia.co.uk | http://www.synchromedia.co.uk

Derick Rethans

22 years ago
On Fri, 21 Nov 2003, Marcus Bointon wrote:
> Ahem, and again, with the attachment...
Try to add it with the .txt extension... Derick

Marcus Bointon

22 years ago
on 21/11/03 14:49, Derick Rethans at derick@php.net wrote:
> Try to add it with the .txt extension...
Thanks for the tip, it's attached this time, hope it works. Marcus
-- Marcus Bointon Synchromedia Limited: Putting you in the picture marcus@synchromedia.co.uk | http://www.synchromedia.co.uk

Derick Rethans

22 years ago
On Fri, 21 Nov 2003, Marcus Bointon wrote:
> on 21/11/03 14:49, Derick Rethans at derick@php.net wrote: > > > Try to add it with the .txt extension... > > Thanks for the tip, it's attached this time, hope it works.
hah, nope. That stupid entourage sends all attachments as application/octen-stream and that is stripped. Put it online and posta link? Derick

Marcus Bointon

22 years ago
on 21/11/03 15:12, Derick Rethans at derick@php.net wrote:
> hah, nope. That stupid entourage sends all attachments as > application/octen-stream and that is stripped.
I just upgraded to 10.3 and will be switching to Mail.app shortly to be MS-free at last...
> Put it online and posta link?
http://www.synchromedia.co.uk/php/html.c.diff.txt Apologies for clogging the list with this. Marcus
-- Marcus Bointon Synchromedia Limited: Putting you in the picture marcus@synchromedia.co.uk | http://www.synchromedia.co.uk

Wez Furlong

22 years ago
Assuming that the table is correct, this patch looks OK to me. --Wez.

Marcus Bointon

22 years ago
on 21/11/03 15:09, Marcus Bointon at marcus@synchromedia.co.uk wrote:
> Thanks for the tip, it's attached this time, hope it works.
Hm. That didn't work either. Is there some specific encoding I should be using for the attachment? It was sent using base64. Not my day... Marcus
-- Marcus Bointon Synchromedia Limited: Putting you in the picture marcus@synchromedia.co.uk | http://www.synchromedia.co.uk

Ilia A.

22 years ago
Where is the patch? :) Ilia