What is the return key?

In a web app, what’s the value of the Return key?

Is it carriage return (chr(13)), linefeed (chi(10)), or carriage return + linefeed?

I’m running on a Mac and seeing a linefeed, I’m concerned about users on Windows (Linux probably uses linefeed).

I hope this question is not too silly.

Mostly It depends on the platform. macOS and Linux are chr(10) and Windows is chr(13)+chr(10).


That’s what I knew. What you’re saying is that there isn’t a separate standard for the web? That is, if I’m on a browser on a Mac and type the Return key in a text area, there will be a chr(10). If I do the same thing on a Windows box I get chr(13)+chr(10).

I’m asking because on the web app I’m working on, I need to generate a pdf, and that requires formatting all the text.

I suggest using ReplaceLineEndings in your code so it’s not special cased. IIRC, I don’t believe that you need to be concerned with line endings in a PDF and that’d defeat the Portable part of Portable Document Format.

1 Like
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.