Converting \\n to CRLF leads to ? character instead

I am using the following code to replace
with a CRLF in a string to be displayed in a text area:

textarea1.text = str.Replace("\ ",chr13)
however, this generates a ? character instead. Instead of Chr(13) I have also tried encodings.utf8.chr(13), encodings.ascii.chr(13), and EndOfLine.Macintosh (I am on a mac). I always get the ? character. Any suggestions?

Why are there diamonds in my user interface?

[quote=61909:@Frederic Pearl]I am using the following code to replace
with a CRLF in a string to be displayed in a text area:

textarea1.text = str.Replace("\ ",chr13)
however, this generates a ? character instead. Instead of Chr(13) I have also tried encodings.utf8.chr(13), encodings.ascii.chr(13), and EndOfLine.Macintosh (I am on a mac). I always get the ? character. Any suggestions?[/quote]
dont do this :stuck_out_tongue:

textarea1.text = str.ReplaceLineEndings(EndOfLine)

might work better

FYI… Endofline.Macintosh is a legacy value, used in OS9
If you are going to use a platform specific EndofLine indicator, the proper one for OSX is EndofLine.Unix

even better:

textarea1.text = str.ReplaceLineEndings(EndOfLine)

Thank much for your replies. I neglected to mention that the input was coming from HTTPSecureSocket. [quote=61911:@Joe Ranieri]Why are there diamonds in my user interface? [/quote] was helpful in this regard. The other methods didn’t work for me, probably because of this. I solved the problem by str = DefineEncoding(str,Encodings.UTF8). I didn’t get around to trying Christian’s solution before finding the above solution. Kudos to Christian though for still trying to help me after I have been out of programming for about 6 years, I come back and you are still answering my silly questions! TY.