code: private static String addLineFeedForNonASCII(String s) {
          if(!s.startsWith("#!")) {
              if (s.indexOf('\n')!=0) {
                  return "\n" + s;
              }
          }
  
          return s;
      }
docs: Older versions of bash have a bug where non-ASCII on the first line
  makes the shell think the file is a binary file and not a script. Adding
  a leading line feed works around this problem.