article

In computing, a non-breaking space (NBSP) is a special space character that prevents an automatic line break (line wrap) at its position. It is also known as a hard space or fixed space. It can also be used to get multiple spaces in a row in systems like HTML that reduce sequences of normal spaces to a single space.

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 dextrou sly" (ie. "am bi dextrou sly").

Uses


Here are some situations in which using nonbreaking spaces is suggested. (Note that you will not be able to see the effects of the space unless your screen is fairly narrow.) Try resizing your browser window and seeing how some of the strings below move to the next line if they are too long to fit.
  • Compound proper names: Van der Waerden
  • Titles: Mr. Jones
  • Parts of a document: Chapter 12
  • Between the dots of an ellipsis: . . .
  • Mathematics: x² + 3
  • Enumeration of cases in running text: (1) Genesis
  • Languages such as French when punctuation should be preceded or followed by a space: « Arrêtez ! », dit-il.
  • Measurements (and other numbers with units): the 100 m dash.
  • Numbers over a thousand, where a thin non-breaking space is used instead of a period or comma to separate groups of three digits: 16 384

Encodings


  • In Unicode, it is U+00A0 and is called the No-Break Space.
  • In ISO/IEC 8859, NBSP is 0xA0.
  • In KOI8-R, NBSP is 0x9A.
  • In EBCDIC, it is 0x41 and is called the No-Break Space.
  • In some versions of extended ASCII, character 255 (0xFF) serves as a nonbreaking space.
  • In HTML, the entity is written as   or  .
  • In TeX, a tilde (~) is used to denote the hard space.

Word processors may use different methods to enter a nonbreaking space on the keyboard. For examples:

Other types


There are several other non-breaking spaces in the Universal Character Set (ISO 10646) and Unicode:

  • Non-breaking thin space, known in Unicode as "NARROW NO-BREAK SPACE" (U+202F)
  • Zero-width non-breaking 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."

See also


Control characters

Geschütztes Leerzeichen | Espace insécable | Hardt mellomrom

 

This article is licensed under the GNU Free Documentation License. It uses material from the "Non-breaking space".

Home Pageartsbusinesscomputersgameshealthhospitalshomekids & teensnewsphysiciansrecreationreferenceregionalscienceshoppingsocietysportsworld