Non-breaking space
From Wikipedia, the free encyclopedia
| It has been suggested that this article or section be merged with Hard space. (Discuss) |
| This article does not cite any references or sources. (February 2007) Please help improve this article by adding citations to reliable sources. Unverifiable material may be challenged and removed. |
In computer-based text processing and digital typesetting, a no-break space (NBSP) is a variant of the space character that prevents an automatic line break (line wrap) at its position. It is also known as a hard space or fixed space.
Contents |
[edit] Explanation
The difference between a NBSP and a normal space is that, when a string including the NBSP comes at the end of the line, and is too long to fit, it will move the whole string to the next line (including the strings that the NBSP connects to). This is analogous to how normal strings wrap. For example, the string "ambidextrously" will never be "broken", and neither will the string "am bi dextrous ly" (i.e. "am bi dextrous ly").
[edit] Use as non-collapsing whitespace
A second common application of the NBSP characters is in plain text file formats for word processing applications (e.g., SGML, HTML, TeX, LaTeX) that treat sequences of white-space characters (such as space, newline, tabulator, form feed, etc.) exactly as if they were a single character. Such collapsing of whitespace allows the author of the plain text file to neatly arrange the text in this form (e.g., by line breaks and indentation), without affecting the typeset result of the line-breaking algorithm.
The no-break space character is not merged with any other neighboring whitespace characters in such applications, and can therefore be used by an author to explicitely insert additional visible space in the formatted text.
[edit] Encodings
- In Unicode and ISO/IEC 10646, it is U+00A0.
- In ISO/IEC 8859, NBSP is 0xA0.
- In KOI8-R, NBSP is 0x9A.
- In EBCDIC, it is 0x41.
- In CP437 and CP850, NBSP is 0xFF.
- In SGML and HTML, the character entity reference
or the numerical character references or represent NBSP. - In TeX and LaTeX, a tilde (~) is used to denote the hard space.
[edit] Keyboard entry methods
None of the existing national or international standards on keyboard layouts currently define an input method for the NBSP character. Therefore, the authors of keyboard drivers or application programs (e.g., word processors) had to invent their own keyboard shortcuts. For example:
- CTRL+SHIFT+SPACE: Microsoft Word
- CTRL+SPACE: WordPerfect, OpenOffice.org
- CTRL+K N S: vim (see vim digraphs)
- OPTION+SPACE: Mac OS
- ALT+0160: Microsoft Windows
- Insert | Symbol dialog box (Latin-1 subset, after ~): many office applications
[edit] Other types
Unicode defines several other no-break space characters that differ from the regular space in width:
- No-break thin space, known in Unicode as "NARROW NO-BREAK SPACE" (U+202F). This is required for French punctuation (before ?, ! or ;).
- Zero-width no-break space, known in Unicode as "ZERO WIDTH NO-BREAK SPACE" (U+FEFF). Note that this character is also used as the UCS BOM (Byte Order Mark). Because of this overloading, RFC 3629 mentions that "Unicode 3.2 adds a new character, U+2060 "WORD JOINER", with exactly the same semantics and usage as U+FEFF except for the signature function, and strongly recommends its exclusive use for expressing word-joining semantics.
[edit] See also
- Hard space
- Space (punctuation)
- Word wrap
- List of XML and HTML character entity referencesde:Geschütztes Leerzeichen
fr:Espace insécable it:Hard space ja:ノーブレークスペース no:Non-breaking space nn:Hardt mellomrom pl:Twarda spacja

