Skip to content

Handling platform specific issues

vazexqi edited this page Feb 10, 2013 · 3 revisions

Here are some platform specific issues that we have to handle:

How to handle newlines from the user?

Always denormalize all Strings that come in. Using String#denormalize in the Groovy Library ensures that all newlines are converted to the native ones that the current program is running on.

How to handle printing of newlines?

Using String.format("Your message%n") will use the platform-specific line ending. The %n does the magic.