@Test public void toUTF8_crtEncodingIsUTF8_equalStringReturned() throws UnsupportedEncodingException { final String str = "qwerty"; final String crtEncoding = StandardCharsets.UTF_8.displayName(); String result = EncodingUtils.toUTF8(str, crtEncoding); assertEquals(str, result); }
public static String toUTF8(@NotNull String str, @NotNull String crtEncoding) throws UnsupportedEncodingException { return new String(str.getBytes(crtEncoding), StandardCharsets.UTF_8); }
EncodingUtils { public static String toUTF8(@NotNull String str, @NotNull String crtEncoding) throws UnsupportedEncodingException { return new String(str.getBytes(crtEncoding), StandardCharsets.UTF_8); } }
EncodingUtils { public static String toUTF8(@NotNull String str, @NotNull String crtEncoding) throws UnsupportedEncodingException { return new String(str.getBytes(crtEncoding), StandardCharsets.UTF_8); } private  EncodingUtils(); }
EncodingUtils { public static String toUTF8(@NotNull String str, @NotNull String crtEncoding) throws UnsupportedEncodingException { return new String(str.getBytes(crtEncoding), StandardCharsets.UTF_8); } private  EncodingUtils(); static String discardBOMChar(@NotNull String str); static String toUTF8(@NotNull String str, @NotNull String crtEncoding); static String escapePotentialMaliciousCharsInTxt(@NotNull String str); static String escapePotentialMaliciousCharsInXml(@NotNull String str); }
EncodingUtils { public static String toUTF8(@NotNull String str, @NotNull String crtEncoding) throws UnsupportedEncodingException { return new String(str.getBytes(crtEncoding), StandardCharsets.UTF_8); } private  EncodingUtils(); static String discardBOMChar(@NotNull String str); static String toUTF8(@NotNull String str, @NotNull String crtEncoding); static String escapePotentialMaliciousCharsInTxt(@NotNull String str); static String escapePotentialMaliciousCharsInXml(@NotNull String str);  }