Xojo Conferences

« MBS Real Studio Plugi… | Home | PHP Functions in MBS … »

Web app and space character

One of my clients recently asked about space characters on web apps. He is used to sometimes put more spaces in the text to increase the distance between words. But with a website, those spaces have no effect.

If you put several spaces in a string, the web browser will compact that to one space. Except if you use a non breaking space. To create a non breaking space on Mac you simply type option-space (alt key and spacebar). On Windows it depends on the application. For example in Microsoft Word and Open Office, it is Ctrl-Shift-Space.

If you are familiar with asc() function in Real Studio, we can tell you that normal space has code point 32 and non breaking space has 160. The unicode standard actually has 12 other different space characters with different width and other properties.

In HTML when sent to browser, the non breaking space will be encoded as   and the browser sees that as content for displaying. This is something I used years ago to have empty table rows in html have the high of normal text rows by using those spaces there.
21 10 12 - 21:08
two comments

You could also process the spaces and replace them with   before putting text inside the database.
Rutger de Jong (URL) - 21 10 12 - 22:20

I think I would prefer to have normal spaces in the database.
Christian Schmitz (URL) - 22 10 12 - 09:14

Remember personal info?

Emoticons / Textile

Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.