java中按汉字拼音排序时,只要有“怡”字,都是排最后的????为什么
import
java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.Comparator;
import java.util.*;
import java.util.Collections;
public class SortPinyin {
public static void main( String[] args ) throws Unsupported
EncodingException {
String[] s = { "孙 ", "孟 ", "宋 ", "尹 ", "廖 ", "张 ", "张 ", "张 ", "徐 ", "昆 ", "曹 ", "曾 ", "怡 "};
String[] c = new String[s.length];
for ( int i = 0; i < s.length; i++ ) {
c[i] = new String( s[i].getBytes( "gbk "), "iso-8859-1 " );
}
/*用数组排序
Arrays.sort( c, new Comparator() {
public int compare( Object o1, Object o2 ) {