public class FileNameEncoder extends Object
Modifier and Type | Method and Description |
---|---|
static String |
encode(String s)
Translates a string into
x-www-form-urlencoded format with
some differences as described at the top of this class. |
static String |
encode(String s,
String enc)
Translates a string into
application/x-www-form-urlencoded
format using a specific encoding scheme with some differences as
described at the top of this class. |
public static String encode(String s)
x-www-form-urlencoded
format with
some differences as described at the top of this class. This method uses
UTF-8 as the encoding scheme to obtain the bytes for unsafe characters.s
- String
to be translated.String
.public static String encode(String s, String enc) throws UnsupportedEncodingException
application/x-www-form-urlencoded
format using a specific encoding scheme with some differences as
described at the top of this class. This method uses the supplied
encoding scheme to obtain the bytes for unsafe characters.
Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilites.
s
- String
to be translated.enc
- The name of a supported
character encoding.String
.UnsupportedEncodingException
- If the named encoding is not supportedFileNameDecoder.decode(java.lang.String, java.lang.String)
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.