How do I visualize CR LF in WORD?

1

2

I'm writing a document where I write down HTTP requests. The requests are set in a monospace font if that matters.

What I'm searching for is a special font (or other means) with which I could visualize the CR LF sequences at the end of the headers.

The output should look like (or be similar to) this screenshot taken from Notepad++:

screenshot

Of course, I could type the requests in an editor and paste a screenshot into WORD, but that isn't what I'm looking for...

eckes

Posted 2012-01-25T10:41:02.867

Reputation: 418

Note that not all typefaces support this sort of thing. It is important, if this is to be published, that the people in charge of designing or laying out a publication are (a) aware of the need for these glyphs; and (b) aware when they are missing. In many occasions, these sorts of characters "drop out" or take on the appearance of blank space, depending on the program and typeface used. – horatio – 2012-01-25T15:29:25.960

Answers

9

Visual symbols for Carriage-Return and Line-Feed

For exactly this purpose, there are Unicode control pictures for CR and LF

 Post /destination?param=value HTTP/1.1 ␍␊
 Accept: text/html, application/xhtml+xml, */* ␍␊

In the above example, "␍" and "␊" is each a single character (not a pair of characters).

In Word you can use reverse highlighting etc to further highlight these characters.


Update 2:

The above are

  • U+240A ␊ Symbol for Line Feed
  • U+240D ␍ Symbol for Carriage Return

Other (arguably more ambiguous) Unicode symbols that are in Arial Unicode MS and which might be used include

  • U+21b2 ↲ Downwards Arrow With Tip Leftwards
  • U+21a9 ↩ Leftwards Arrow With Hook
  • U+2199 ↙ South West Arrow

See also Jukka K. Korpela's answer suggesting:

  • U+25C4 ◄ Black Left-Pointing Triangle
  • U+25BC ▼ Black Down-Pointing Triangle

Update 1:

Entering Unicode characters in Microsoft Word.

There seem to be several methods:

  1. type the hexadecimal code and press Alt+X
  2. type the hexadecimal code and press Alt+C (see comment below)
  3. type Alt+0 decimal unicode value (need for 0 depends on language)
  4. type Alt+x hexadecimal unicode value (may need registry tweak†)
  5. press Alt+Shift to invoke IME, enter hex code (install CN/TW IME first)
  6. start, run, "charmap", locate character, select, copy, alt-tab, paste
  7. Cut & Paste from another source (web-page, PDF, etc)
  8. Create your own shortcut using Word's insert, symbol dialog.

Note: Some of the above may only apply to specific versions of Microsoft Word or may depend on system settings (e.g. locale related settings).

See articles at Fileformat and Wikipedia

Remembering Hexadecimal or decimal codes is difficult. For frequently used characters there are easier to remember shortcuts‡ in Word.

† HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad = string "1"
‡ See http://word.mvps.org/faqs/general/insertspecchars.htm

RedGrittyBrick

Posted 2012-01-25T10:41:02.867

Reputation: 70 632

That's what I was looking for. How do I insert them in Word? – eckes – 2012-01-25T12:13:44.543

@eckes Just copy & paste from the PDF? – Daniel Beck – 2012-01-25T12:30:30.980

1One way to insert in MS-Word is 240A Alt+X 240D Alt+X. If you are doing this a lot you can set up a shortcut key in Word's "insert symbol" dialog. – RedGrittyBrick – 2012-01-25T12:33:05.157

1@RedGrittyBrick Regular Alt+NumericDigits codes should work too, right? – Daniel Beck – 2012-01-25T12:42:26.327

@DanielBeck: I tried it but it seems like I cannot copy from the PDF. – eckes – 2012-01-25T12:43:27.223

@eckes Odd. Works for me without problems. – Daniel Beck – 2012-01-25T12:44:53.000

@RedGrittyBrick: In my WORD, I have to hit 240d followed by Alt-C – eckes – 2012-01-25T13:31:48.853

@eckes,@DanielBeck: I have updated the answer with the information you provided. Thanks. – RedGrittyBrick – 2012-01-25T14:50:43.340

1

On Mac OS X, you can get these characters from the Character Palette, available from /System/Library/InputMethods or the Character Viewer menu item in the Input menu menu bar item you can enable in System Preferences » Language & Text » Input Sources.

The symbols are in the Technical Symbols collection, or the Unicode collection, offset 2400, Control Pictures.

enter image description here

You can add these characters to your Word document by drag & drop from the Character Palette.

Daniel Beck

Posted 2012-01-25T10:41:02.867

Reputation: 98 421

0

I just found a way to achieve something quite similar to the screenshot taken from Notepad++:

  1. Write down one line of the HTTP request, for example
    POST /destination?param=value HTTP/1.1

  2. Go to the end of the line and add something like [CR][LF]

  3. Apply some styling to that text (for example, use the text marker tool of word to make the background black and style the text being bold and white. Now, the line looks like this: first line

  4. To save that styling and automatically apply it to new lines, go to ExtrasAutoCorrect and think up a shortcut that should be replaced by that pattern (for example <CRLF>). Be sure to select the bullet Formatted Text.

  5. Whenever you have to insert the styled pattern, simply type <CRLF> and WORD will auto-correct <CRLF> to be the styled pattern: enter image description here

eckes

Posted 2012-01-25T10:41:02.867

Reputation: 418

0

I would suggest some graphic symbols like ◄▼ (U+25C4 U+25BC), on the grounds that they are available in some common monospace fonts and simple enough to be recognized on screen.

The Control Pictures, suggested in another answer, would be more logical, but in their reference design, they contain letters in such a small size that they are very hard to read in normal text sizes. Moreover, very few fonts contain them, see http://www.fileformat.info/info/unicode/char/240a/fontsupport.htm Among the fonts listed there, the Everson Mono fonts are the only monospace fonts, as far as I can see. The fonts are not commonly available but need to be downloaded separately, and a small fee is imposed by their author. Moreover, in those fonts, the glyphs are very different from the reference glyphs, and it is debatable whether they are intuitively more obvious than some common graphic symbols.

Jukka K. Korpela

Posted 2012-01-25T10:41:02.867

Reputation: 4 475