protected static File[] createTempFiles(File file, File tempFolder, String... exts)
		throws IOException
	{
		File[] result = new File[exts.length + 1];

		String path = file.getAbsolutePath();

		//Check if entire path consists of ASCII characters
		boolean ascii = true;
		for (int n = 0; n < path.length(); n++) {
			if (path.charAt(n) > 127) {
				ascii = false;
				break;
			}
		}

		if (ascii) {
			result[0] = file;
		} else {
			File dst = null;
			String pre = String.format("temp-" + Thread.currentThread().hashCode());
			String post = StringUtil.getExtension(file.getName()).toLowerCase();
			while (dst == null || dst.exists()) {
				dst = new File(tempFolder, pre + "-" + StringUtil2.getRandomString(4) + "." + post);
			}
			FileUtil.copyFile(file, dst);
			result[0] = dst;
		}

		for (int n = 0; n < exts.length; n++) {
			String p = StringUtil.replaceExt(result[n].getAbsolutePath(), exts[n]);
			File f = new File(p);

			int t = 1;
			while (f.exists()) {
				t++;
				f = new File(StringUtil.stripExtension(p) + "-" + t + "." + StringUtil.getExtension(p));
			}
			result[n+1] = f;
		}

		return result;
	}