将乱码后的中文放入redis-key中,该怎么取值
*
* @throws UnsupportedEncodingException
*/
private static void method1() throws UnsupportedEncodingException {
addKeyToHash();
// 根据key取出
// 转为乱码格式的字符串
String s = "天津";
byte[] n2 = s.getBytes("gb2312");
String gn2 = new String(n2, "utf-8");
// 应该用对应的乱码去取
Set
Iterator
while (it.hasNext()) {
Tuple t = it.next();
System.out.println("element:" + t.getElement().toString() + ",score:" + t.getScore());
}
}