code: public static String toReadableForm(String str)
      {
          String ret = str;
          if(str != null && str.length() > 0 
              && str.indexOf("\n") != -1 
              && str.indexOf("\r") == -1)
          {
              str.replaceAll("\n", "\r\n");
          }
  
          return ret;
      }
docs: Converts the given string with CR and LF character correctly formatted.
  @param str The string to be converted
  @return The converted string