String 字符编码有关问题

String 字符编码问题1.由客户端发送来的数据,在server解析的时候,利用Pattern p Pattern.compile(patter

String 字符编码问题
1.
由客户端发送来的数据,在server解析的时候,利用

  Pattern p = Pattern.compile(pattern); 
      Matcher m = p.matcher(str); 
  if(!m.matches()){
  log.debug("The result is :" + m.matches());

  }

进行正则校验的时候出错。
期间debug接受的数据,并自写main函数测试都没有问题。