Encoding of eol in multiline wysiwyg strings

Jarrett Billingsley jarrett.billingsley at gmail.com
Tue Feb 17 05:35:01 PST 2009


On Tue, Feb 17, 2009 at 4:41 AM, KlausO <oberhofer at users.sf.net> wrote:
> Hello,
>
> does the D specification specify how the "end of line" is encoded when you
> use wysiwyg strings. Currently it seems to be '\n' on windows
> (And I guess it will '\n' on linux, too.).
> Is this the intended behaviour ?

http://www.digitalmars.com/d/1.0/lex.html

"Wysiwyg Strings

Wysiwyg quoted strings are enclosed by r" and ". All characters
between the r" and " are part of the string except for EndOfLine which
is regarded as a single \n character."

> It's not a big issue but somtimes when you use wysiwyg strings, string
> concatenation and import expressions to combine some text the result is a
> string with mixed EOL encodings.
> Thanks for clarifying,

It's the import() expression that's messing things up.  It just loads
the file verbatim and does no line-ending conversions.


More information about the Digitalmars-d-learn mailing list