本文整理了Java中org.testng.internal.Utils.escapeUnicode()
方法的一些代码示例,展示了Utils.escapeUnicode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.escapeUnicode()
方法的具体详情如下:
包路径:org.testng.internal.Utils
类名称:Utils
方法名:escapeUnicode
暂无
代码示例来源:origin: org.testng/testng
/**
* Writes the content of the sb string to the file named filename in outDir encoding the output as UTF-8.
* If outDir does not exist, it is created.
*
* @param outputDir the output directory (may not exist). If <tt>null</tt> then current directory is used.
* @param fileName the filename
* @param sb the file content
*/
public static void writeUtf8File(@Nullable String outputDir, String fileName, String sb) {
final String outDirPath= outputDir != null ? outputDir : "";
final File outDir= new File(outDirPath);
writeFile(outDir, fileName, escapeUnicode(sb), "UTF-8");
}
代码示例来源:origin: cbeust/testng
/**
* Writes the content of the sb string to the file named filename in outDir encoding the output as
* UTF-8. If outDir does not exist, it is created.
*
* @param outputDir the output directory (may not exist). If <tt>null</tt> then current directory
* is used.
* @param fileName the filename
* @param sb the file content
*/
public static void writeUtf8File(@Nullable String outputDir, String fileName, String sb) {
final String outDirPath = outputDir != null ? outputDir : "";
final File outDir = new File(outDirPath);
writeFile(outDir, fileName, escapeUnicode(sb), "UTF-8");
}
代码示例来源:origin: cbeust/testng
@Test
public void escapeUnicode() {
assertEquals(Utils.escapeUnicode("test"), "test");
assertEquals(
Utils.escapeUnicode(String.valueOf(INVALID_CHAR)), String.valueOf(REPLACEMENT_CHAR));
}
内容来源于网络,如有侵权,请联系作者删除!