/usr/share/doc/racket/net/unihead.html is in racket-doc 6.7-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>9 Header Field Encoding</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">▼</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Net:<span class="mywbr"> </span> Networking Libraries</a></td></tr></table></div><div class="tocviewsublistonly" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="http-client.html" class="tocviewlink" data-pltdoc="x">HTTP Client</a></td></tr><tr><td align="right">2 </td><td><a href="url.html" class="tocviewlink" data-pltdoc="x">URLs and HTTP</a></td></tr><tr><td align="right">3 </td><td><a href="uri-codec.html" class="tocviewlink" data-pltdoc="x">URI Codec:<span class="mywbr"> </span> Encoding and Decoding URIs</a></td></tr><tr><td align="right">4 </td><td><a href="ftp.html" class="tocviewlink" data-pltdoc="x">FTP:<span class="mywbr"> </span> Client</a></td></tr><tr><td align="right">5 </td><td><a href="sendurl.html" class="tocviewlink" data-pltdoc="x">Send URL:<span class="mywbr"> </span> Opening a Web Browser</a></td></tr><tr><td align="right">6 </td><td><a href="smtp.html" class="tocviewlink" data-pltdoc="x">SMTP:<span class="mywbr"> </span> Sending E-<wbr></wbr>Mail</a></td></tr><tr><td align="right">7 </td><td><a href="sendmail.html" class="tocviewlink" data-pltdoc="x"><span class="stt">sendmail</span>:<span class="mywbr"> </span> Sending E-<wbr></wbr>Mail</a></td></tr><tr><td align="right">8 </td><td><a href="head.html" class="tocviewlink" data-pltdoc="x">Headers:<span class="mywbr"> </span> Parsing and Constructing</a></td></tr><tr><td align="right">9 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Header Field Encoding</a></td></tr><tr><td align="right">10 </td><td><a href="imap.html" class="tocviewlink" data-pltdoc="x">IMAP:<span class="mywbr"> </span> Reading Mail</a></td></tr><tr><td align="right">11 </td><td><a href="pop3.html" class="tocviewlink" data-pltdoc="x">POP3:<span class="mywbr"> </span> Reading Mail</a></td></tr><tr><td align="right">12 </td><td><a href="mime.html" class="tocviewlink" data-pltdoc="x">MIME:<span class="mywbr"> </span> Decoding Internet Data</a></td></tr><tr><td align="right">13 </td><td><a href="base64.html" class="tocviewlink" data-pltdoc="x">Base 64:<span class="mywbr"> </span> Encoding and Decoding</a></td></tr><tr><td align="right">14 </td><td><a href="qp.html" class="tocviewlink" data-pltdoc="x">Quoted-<wbr></wbr>Printable:<span class="mywbr"> </span> Encoding and Decoding</a></td></tr><tr><td align="right">15 </td><td><a href="dns.html" class="tocviewlink" data-pltdoc="x">DNS:<span class="mywbr"> </span> Domain Name Service Queries</a></td></tr><tr><td align="right">16 </td><td><a href="nntp.html" class="tocviewlink" data-pltdoc="x">NNTP:<span class="mywbr"> </span> Newsgroup Protocol</a></td></tr><tr><td align="right">17 </td><td><a href="tcp.html" class="tocviewlink" data-pltdoc="x">TCP:<span class="mywbr"> </span> Unit and Signature</a></td></tr><tr><td align="right">18 </td><td><a href="tcp-redirect.html" class="tocviewlink" data-pltdoc="x">TCP Redirect:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">tcp^</span></span> via Channels</a></td></tr><tr><td align="right">19 </td><td><a href="ssl-tcp-unit.html" class="tocviewlink" data-pltdoc="x">SSL Unit:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">tcp^</span></span> via SSL</a></td></tr><tr><td align="right">20 </td><td><a href="cgi.html" class="tocviewlink" data-pltdoc="x">CGI Scripts</a></td></tr><tr><td align="right">21 </td><td><a href="cookie.html" class="tocviewlink" data-pltdoc="x">Cookie:<span class="mywbr"> </span> Legacy HTTP Client Storage</a></td></tr><tr><td align="right">22 </td><td><a href="git-checkout.html" class="tocviewlink" data-pltdoc="x">Git Repository Checkout</a></td></tr><tr><td align="right"></td><td><a href="doc-bibliography.html" class="tocviewlink" data-pltdoc="x">Bibliography</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><a href="#%28def._%28%28lib._net%2Funihead..rkt%29._encode-for-header%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">encode-<wbr></wbr>for-<wbr></wbr>header</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._net%2Funihead..rkt%29._decode-for-header%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">decode-<wbr></wbr>for-<wbr></wbr>header</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._net%2Funihead..rkt%29._generalize-encoding%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">generalize-<wbr></wbr>encoding</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="head.html" title="backward to "8 Headers: Parsing and Constructing"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Net: Networking Libraries"" data-pltdoc="x">up</a> <a href="imap.html" title="forward to "10 IMAP: Reading Mail"" data-pltdoc="x">next →</a></span> </div><h3 x-source-module="(lib "net/scribblings/net.scrbl")" x-source-pkg="net-doc" x-part-tag=""unihead"">9<tt> </tt><a name="(part._unihead)"></a><a name="(mod-path._net/unihead)"></a>Header Field Encoding</h3><p><div class="SIntrapara"><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">net/unihead</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">net-lib</span></span></td></tr></table></div><div class="SIntrapara">The <a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">net/unihead</span></a> module
provides utilities for encoding and decoding header fields using the
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">=?</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">encoding</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">transport</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">?=</span><span class="hspace"></span></span> format.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._net/unihead..rkt)._encode-for-header))"></a><span title="Provided from: net/unihead | Package: net-lib"><span class="RktSym"><a href="#%28def._%28%28lib._net%2Funihead..rkt%29._encode-for-header%29%29" class="RktValDef RktValLink" data-pltdoc="x">encode-for-header</a></span></span><span class="hspace"> </span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">s</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Encodes <span class="RktVar">s</span> for use in a header.</div></p><p>If <span class="RktVar">s</span> contains only ASCII characters, then the result string
will have the same content as the given string. If <span class="RktVar">s</span> contains
only Latin-1 characters, then on each CRLF-delimited line, the
space-delimited sequence containing all non-ASCII characters in
<span class="RktVar">s</span> is encoded with a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">=?ISO-8859-1?Q?</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">?=</span><span class="hspace"></span></span> sequence. If <span class="RktVar">s</span>
contains non-Latin-1 characters, then on each CRLF-delimited line, a
space-delimited sequence containing all non-ASCII characters in
<span class="RktVar">s</span> is encoded with a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">=?UTF-8?B?</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">?=</span><span class="hspace"></span></span> sequence.</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._net%2Funihead..rkt%29._encode-for-header%29%29" class="RktValLink" data-pltdoc="x">encode-for-header</a></span><span class="hspace"> </span><span class="RktVal">"English"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"English"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._net%2Funihead..rkt%29._encode-for-header%29%29" class="RktValLink" data-pltdoc="x">encode-for-header</a></span><span class="hspace"> </span><span class="RktVal">"français"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"=?ISO-8859-1?Q?fran=E7ais?="</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._net%2Funihead..rkt%29._encode-for-header%29%29" class="RktValLink" data-pltdoc="x">encode-for-header</a></span><span class="hspace"> </span><span class="RktVal">"→"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"=?UTF-8?B?4oaS?="</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._net%2Funihead..rkt%29._encode-for-header%29%29" class="RktValLink" data-pltdoc="x">encode-for-header</a></span><span class="hspace"> </span><span class="RktVal">"→\r\nboth → and français here"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"=?UTF-8?B?4oaS?=\r\nboth =?UTF-8?B?4oaSIGFuZCBmcmFuw6dhaXM=?= here"</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._net/unihead..rkt)._decode-for-header))"></a><span title="Provided from: net/unihead | Package: net-lib"><span class="RktSym"><a href="#%28def._%28%28lib._net%2Funihead..rkt%29._decode-for-header%29%29" class="RktValDef RktValLink" data-pltdoc="x">decode-for-header</a></span></span><span class="hspace"> </span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">s</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Decodes header fields that use the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">=?</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">encoding</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">transport</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">?=</span><span class="hspace"></span></span> encoding format. The
specified <span class="sroman">‹<span style="font-style: italic">encoding</span>›</span> is generalized via
<span class="RktSym"><a href="#%28def._%28%28lib._net%2Funihead..rkt%29._generalize-encoding%29%29" class="RktValLink" data-pltdoc="x">generalize-encoding</a></span> before decoding content.</div></p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._net%2Funihead..rkt%29._decode-for-header%29%29" class="RktValLink" data-pltdoc="x">decode-for-header</a></span><span class="hspace"> </span><span class="RktVal">"English"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"English"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._net%2Funihead..rkt%29._decode-for-header%29%29" class="RktValLink" data-pltdoc="x">decode-for-header</a></span><span class="hspace"> </span><span class="RktVal">"=?UTF-8?B?4oaS?= =?ISO-8859-1?Q?fran=E7ais?="</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"→ français"</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._net/unihead..rkt)._generalize-encoding))"></a><span title="Provided from: net/unihead | Package: net-lib"><span class="RktSym"><a href="#%28def._%28%28lib._net%2Funihead..rkt%29._generalize-encoding%29%29" class="RktValDef RktValLink" data-pltdoc="x">generalize-encoding</a></span></span><span class="hspace"> </span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=if.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._or%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=bytestrings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._bytes%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">s</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=if.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._or%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=bytestrings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._bytes%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Generalizes the encoding name <span class="RktVar">s</span> to compensate for typical
mailer bugs: Latin-1 and ASCII encodings are geenralized to
WINDOWS-1252; GB and GB2312 are generalized to GBK; and KS_C_5601-1987
is generalized to CP949.</div></p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="head.html" title="backward to "8 Headers: Parsing and Constructing"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Net: Networking Libraries"" data-pltdoc="x">up</a> <a href="imap.html" title="forward to "10 IMAP: Reading Mail"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|