String originalString = "Hello, world!"; byte[] byteArr = originalString.getBytes(StandardCharsets.UTF_8); String encodedString = Base64.encodeBase64String(byteArr); System.out.println(encodedString); String originalUrl = "https://www.example.com/?query=hello world"; URLCodec codec = new URLCodec(); String encodedUrl = codec.encode(originalUrl); String decodedUrl = codec.decode(encodedUrl); System.out.println(decodedUrl);


上一篇:
下一篇:
切换中文