[Issue 2201] Unescaped carriage return ('\r') in string is changed into different EOL.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 7 19:10:34 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2201





------- Comment #3 from business3 at twistedpairgaming.com  2008-07-07 21:10 -------
(In reply to comment #2)

After thinking about this some more, it does make sense that the embedded
characters should be turned into system-specific EOLs. But that does mean my
technique is flawed and shouldn't be able to work anyway. Only solution I can
think of is that maybe the compiler somehow remembers that the string literal
was put there by a string mixin and therefore should keep line-endings as-is.
But that seems kind of messy and might still cause problems for other
cross-platform scenarios. I guess I'll just hope for CTFE's to progress to the
point where they could reliably do an "escapeString()" (Maybe there's some way
they currently can, but I've tried using some "replace()" stuff in a CTFE and
the compiler threw an out of memory exception, so it doesn't seem to be
doable).

In any case, this is still illustrates a discrepancy between the documentation
and actual behavior (at least when it occurs in a string mixin), so I'll leave
this open.


-- 



More information about the Digitalmars-d-bugs mailing list