You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by zh...@gmail.com on 2010/05/04 10:45:43 UTC

Re: Explicitly use UTF-8 when turning strings to byte arrays (issue977046)

http://codereview.appspot.com/977046/diff/1/6
File
java/common/src/main/java/org/apache/shindig/common/util/Base32.java
(right):

http://codereview.appspot.com/977046/diff/1/6#newcode40
java/common/src/main/java/org/apache/shindig/common/util/Base32.java:40:
return ENCODER.encode(arg0).getBytes("US-ASCII");
You can use StringUtils.getBytesUsAscii which already convert the
exception to runtime exception.

http://codereview.appspot.com/977046/diff/1/23
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/DefaultUrlGenerator.java
(right):

http://codereview.appspot.com/977046/diff/1/23#newcode85
java/gadgets/src/main/java/org/apache/shindig/gadgets/DefaultUrlGenerator.java:85:
jsChecksum = HashUtil.checksum(jsBuf.toString().getBytes("UTF-8"));
Maybe use StringUtils.getBytesUtf8 instead which already convert the
exception for you (an probably in many other places)

http://codereview.appspot.com/977046/show