修改网上的汉字转拼音包,将部分代码替换吧
--原来的取汉字的编码,获得高低位
--n_ascii := ascii(v_char);
--n_ord_high := trunc(n_ascii/256,0);
--n_ord_low := n_ascii-(n_ord_high*256);
--DBMS_OUTPUT.PUT_LINE('n_ascii = '||to_char(n_ascii,'9999999'));
--DBMS_OUTPUT.PUT_LINE('n_ord_high = '||to_char(n_ord_high,'9999999'));
--DBMS_OUTPUT.PUT_LINE('n_ord_low = '||to_char(n_ord_low,'9999999'));
--换成新的,通过编码转换将UTF8的编码格式转换成ZHS16GBK格式的编码,获得高低位
Select replace(substrb(dump(convert(v_char,'ZHS16GBK','UTF8'),1010),instrb(dump(convert(v_char,'ZHS16GBK','UTF8'),1010),'UTF8:')),'UTF8: ','') into lv_bytes from dual;
li_pos:=instr(lv_bytes,',');
n_ord_high := to_number(substr(lv_bytes,1,li_pos-1));
n_ord_low := to_number(substr(lv_bytes,li_pos+1));
--dbms_output.put_line(lv_bytes);
--dbms_output.put_line(substr(lv_bytes,1,li_pos-1));
--dbms_output.put_line(substr(lv_bytes,li_pos+1));