Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
making this work for Android: java.lang.String.getBytes(java.nio.char…
Browse files Browse the repository at this point in the history
…set.Charset) is not present
  • Loading branch information
kiril committed Dec 10, 2010
1 parent f36037f commit 3847761
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public Mustache compile(Reader br, Stack<String> scope, AtomicInteger currentLin
}
try {
MessageDigest md = MessageDigest.getInstance("SHA1");
byte[] digest = md.digest(code.toString().getBytes(Charset.forName("UTF-8")));
byte[] digest = md.digest(code.toString().getBytes("UTF-8"));
StringBuilder hash = new StringBuilder();
for (byte aDigest : digest) {
hash.append(Integer.toHexString(0xFF & aDigest));
Expand Down

0 comments on commit 3847761

Please sign in to comment.