| Thread overview | |||||
|---|---|---|---|---|---|
|
May 12, 2016 CRLF in wysiwyg string literals? | ||||
|---|---|---|---|---|
| ||||
Writing a lot of server side D code lately, and bummed the usual `string literals` (or r"string literals") will only use '\n' as the End of line character, while HTTP (and others too) use CRLF for EOL. One way is to create a CTFE function that replaces all \n with \r\n, and call this on all string literals. Another idea I just had was to reserve the rn prefix for such strings, ie. rn"This string uses CRLF new lines." The rn prefix would reflect the usual \r\n CRLF pairs. (Perhaps confusing, since the r doesn't actual mean CR, and there's no n prefix either.) Just a thought. How have others solved this? Short of using \r\n\r\n, that is. L. | ||||
May 12, 2016 Re: CRLF in wysiwyg string literals? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Lionello Lunesu | For HTTP you can't use anything but escape sequences. AFAIK, they apply only to protocol headers, the content can be anything. | |||
May 13, 2016 Re: CRLF in wysiwyg string literals? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Kagamin | On 12/5/2016 16:38, Kagamin wrote:
> For HTTP you can't use anything but escape sequences. AFAIK, they apply
> only to protocol headers, the content can be anything.
Not just HTTP, MIME multipart/mixed content also requires CRLF, as does application/http content.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply