Description对应的中文是"QVOD媒体播放服务"public boolean ReadService(String servicename) {        try {            RegistryKey software = Registry.HKEY_LOCAL_MACHINE.openSubKey(
                    "SYSTEM\\ControlSet001\\Services\\",
                    RegistryKey.ACCESS_READ);
            RegistryKey subkey = software.openSubKey(servicename);
            String subValue = subkey.getStringValue("Description");            }catch(Exception err){         }
           System.out.println(subValue);
}打印出的是一串不知道是什么编码的字符串
QVOD�1�5�1�9�1�4¥�1�8�1�5�1�3�1�7�1�3�1�8�1�6�1�5
      问有什么方法得到他的原有字符串?
用中文在写进注册表的时候也有乱码,急!

解决方案 »

  1.   

    进行字符转码试试看
    subValue =new String(subValue .getBytes("..."),"GB2312");
      

  2.   

    你把Description在注册表里的值贴到这里来看看。
      

  3.   

    名称                 类型            数据
    Description       REG_SZ         QVOD媒体播放服务
    QVOD媒体播放服务对应的16进制是   51 00 56 00 4F 00 44 00 
                                  92 5A 53 4F AD 64 3E 65
                                   0D 67 A1 52 00 00