得到漢字的拼音碼

2021-06-13 22:56:24 字數 1583 閱讀 9383

create    function   f_getpy(@str   nvarchar(4000)) 

returns nvarchar(4000)

as begin

declare @strlen int,@re nvarchar(4000)

declare @t table(chr nchar(1) collate chinese_prc_ci_as,letter nchar(1))

insert into @t(chr,letter)

select '吖 ', 'a ' union all select '八 ', 'b ' union all

select '嚓 ', 'c ' union all select '咑 ', 'd ' union all

select '妸 ', 'e ' union all select '發 ', 'f ' union all

select '旮 ', 'g ' union all select '鉿 ', 'h ' union all

select '丌 ', 'j ' union all select '咔 ', 'k ' union all

select '垃 ', 'l ' union all select '嘸 ', 'm ' union all

select '拏 ', 'n ' union all select '噢 ', 'o ' union all

select '妑 ', 'p ' union all select '七 ', 'q ' union all

select '呥 ', 'r ' union all select '仨 ', 's ' union all

select '他 ', 't ' union all select '屲 ', 'w ' union all

select '夕 ', 'x ' union all select '丫 ', 'y ' union all

select '帀 ', 'z '

select @strlen=len(@str),@re= ' '

while @strlen> 0

begin

select top 1 @re=letter+@re,@strlen=@strlen-1

from @t a where chr <=substring(@str,@strlen,1)

order by chr desc

if @@rowcount=0

select @re=substring(@str,@strlen,1)+@re,@strlen=@strlen-1

end

return(@re)

end

sql函式 漢字拼音碼

create or replace function to piny p name in varchar2 return varchar2 as v compare varchar2 100 v return varchar2 4000 function f nlssort p word in va...

C 取拼音碼

取拼音碼 using system using system.collections.generic using system.text namespace sunhotel static public string getchinesespell string strtext return mys...

拼音碼表的生成

拼音碼表的生成 啟動輸入法生成器在逆轉換選項卡中裝入window的拼音輸入法並將其儲存為文 本檔案 winpy.txt 備用。下面的 將拼音碼表檔案 文字 裝入到陣列 pymb中,結構為 拼音,漢字.碼表轉換時間較長,應轉換後另行儲存 filename pymb.txt if file exists...