[問題] 請問 Net::SNMP 處理中文字串問題

看板Perl作者 (ing)時間18年前 (2006/10/19 13:56), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
您好,在下利用 Net::SNMP 模組向所管設備做了 gettable 的要求, 傳回一個 hash array , 然後 print 出來 但是 hash array 之中的英文字串可以正常顯示, 中文字串卻變成一串十六進位數字.... 1.3.6.1.2.1.25.6.3.1.2.84 : 84 : LevelOne Projector Server Player 1.9.4 1.3.6.1.2.1.25.6.3.1.2.72 : 72 : 0x57696e646f777320585020a677a5fea9caa7f3b77320284b4239313433383829 1.3.6.1.2.1.25.6.3.1.2.55 : 55 : 0x57696e646f777320585020a677a5fea9caa7f3b77320284b4239303131393029 試著用過 pack("c",hex($str)) 但是亦不能正確顯示。 想請教該如何把它變回中文字碼?? 感謝~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.22.18.89
文章代碼(AID): #15DuGeLd (Perl)
文章代碼(AID): #15DuGeLd (Perl)