cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nlivens <...@git.apache.org>
Subject [GitHub] cloudstack pull request: Fix NuageVsp errors for build-master-slow...
Date Fri, 20 Nov 2015 12:21:19 GMT
Github user nlivens commented on the pull request:

    https://github.com/apache/cloudstack/pull/1092#issuecomment-158381857
  
    @DaanHoogland, how about the following piece of code then? In this case we are using the
<code>getPrefferedCharset()</code>
    
    ```java
        public static String encodePasswordUtf8(String originalPassword) {
            byte[] passwordBytes = originalPassword.getBytes(StringUtils.getPreferredCharset());
            byte[] encodedPasswordBytes = Base64.encodeBase64(passwordBytes);
            return new String(encodedPasswordBytes, StringUtils.getPreferredCharset());
        }
    
        public static String decodePasswordUtf8(String encodedPassword) {
            byte[] encodedPasswordBytes = encodedPassword.getBytes(StringUtils.getPreferredCharset());
            byte[] passwordBytes = Base64.decodeBase64(encodedPasswordBytes);
            return new String(passwordBytes, StringUtils.getPreferredCharset());
        }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message