[問題] 如何取得系統字元編碼或使用者輸入的編碼?

看板Python作者 ( )時間13年前 (2011/03/15 22:02), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
請教一下各位, user_input = raw_input(["Search item"]).decode("編碼") 我需要透過decode將輸入的資料正確的轉成utf8, 但是在繁中WinXP底下透過sys.getdefaultencoding()取得編碼為Ascii, 想請教一下, 假設我希望可以處理多國語言, 要如何取得正確的編碼順利的轉成utf8呢? 謝謝:) -- ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ 國 立 聯 合 大 學 (理工/電資/管理/技術/客家)院所 招生中 National United University ─────────────────────────────────── 首頁 http://www.nuu.edu.tw BBS telnet://uun.twbbs.org -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.135.19.80
文章代碼(AID): #1DVt62Vt (Python)
文章代碼(AID): #1DVt62Vt (Python)