Forum Moderators: coopster

Message Too Old, No Replies

Writing non-breaking spaces

Is chr(160) as good as ' '

         

directrix

9:28 am on Feb 7, 2007 (gmt 0)

10+ Year Member



My script needs to write (a small number of) non-breaking spaces. I'm specifying charset=iso-8859-1 (in the HTTP header and HTML meta.)

Is chr(160) as good an option as ' '? (Note that chr(160) occupies one byte, while the named entity, ' ', occupies six bytes.) Is chr(160) as widely supported by browsers as ' '? Is it always rendered as a space?

mcibor

11:31 am on Feb 7, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think you'll need to just try it out and test it on all possible browsers (lynx, IE, Netscape, Mozilla, Opera, Safari) and if it shows correctly then it's OK

I know there may be some problem with copying and pasting to Word. but otherwise it should work OK.

Regards
Michal

PS. Is 5 bytes such a big difference for you?