[ https://issues.apache.org/jira/browse/DIRSERVER-2097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16877490#comment-16877490 ]
Emmanuel Lecharny edited comment on DIRSERVER-2097 at 7/3/19 5:07 AM: ---------------------------------------------------------------------- Side note: we have a {{Strings.getBytesUtf8( string )}} method in the LDAP API that gets the UTF-8 based byte[] from a String : {code:java} /** * Return UTF-8 encoded byte[] representation of a String * * @param string The string to be transformed to a byte array * @return The transformed byte array */ public static byte[] getBytesUtf8( String string ) { if ( string == null ) { return EMPTY_BYTES; } return string.getBytes( StandardCharsets.UTF_8 ); } {code} was (Author: elecharny): Side note: we have a {{Strings.getBytesUtf8( string )}} method that get the UTF-8 based byte[] from a String : /** * Return UTF-8 encoded byte[] representation of a String * * @param string The string to be transformed to a byte array * @return The transformed byte array */ public static byte[] getBytesUtf8( String string ) { if ( string == null ) { return EMPTY_BYTES; } return string.getBytes( StandardCharsets.UTF_8 ); } > Fix usage of default charset|locale|timezone and enable forbiddenapis check > --------------------------------------------------------------------------- > > Key: DIRSERVER-2097 > URL: https://issues.apache.org/jira/browse/DIRSERVER-2097 > Project: Directory ApacheDS > Issue Type: Task > Components: core > Reporter: Stefan Seelmann > Assignee: Stefan Seelmann > Priority: Major > Fix For: 2.0.0 > > Attachments: forbiddenapis.txt, forbiddenapistests.txt > > > Fix implicit usages of default character set, locales, and timezones. Enable > "forbiddenapis" maven plugin > (https://github.com/policeman-tools/forbidden-apis/wiki/MavenUsage). -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org For additional commands, e-mail: dev-h...@directory.apache.org