PowerShell Invoke-WebRequest 編碼問題(Bug5 內容) (Big5)

文章推薦指數: 80 %
投票人數:10人

這年頭還在用Bug5 (Big5) 編碼提供資料的網站都該下十八層地獄以下只能正確讀取Bug5 編碼的網頁,不是Bug5 to UTF-8 轉換編碼. 2021-05-31 PowerShellInvoke-WebRequest編碼問題(Bug5內容)(Big5) 這年頭還在用Bug5(Big5)編碼提供資料的網站都該下十八層地獄以下只能正確讀取Bug5編碼的網頁,不是Bug5toUTF-8轉換編碼 $URL='Somewhereinhell'; $BIG5=[System.Text.Encoding]::GetEncoding(950) $UTF8=[System.Text.Encoding]::GetEncoding(65001) $ISO88591=[System.Text.Encoding]::GetEncoding(28591)#ISO8859-1,Latin-1 [System.IO.File]::WriteAllText(('C:\Temp\SomeData.txt'),($BIG5.GetString(([System.Text.Encoding]::Convert($UTF8,$ISO88591,($UTF8.GetBytes((Invoke-RestMethod-Uri$URL))))))),$BIG5); Postedby Dino9021 at 5/31/202105:20:00下午 以電子郵件傳送這篇文章BlogThis!分享至Twitter分享至Facebook分享到Pinterest Labels: PowerShell 沒有留言: 張貼留言 較新的文章 較舊的文章 首頁 訂閱: 張貼留言(Atom) 總網頁瀏覽量 搜尋文章 追蹤本網誌 網站交流 Dino9021的Youtube頻道 隨遇而安-強森王 iInfo資訊交流 文章分類 上海迪士尼度假區 (10) 大食之樂 (1) 工作三分之一 (18) 日本旅遊 (13) 字幕 (1) 伺服器虛擬化 (6) 我思故我在 (16) 社會大學 (1) 軍中日記 (64) 料理煮廚 (9) 旅遊玩樂 (1) 清華回憶 (6) 清華電台THBS (4) 異想天開 (5) 碎碎唸 (14) 電腦知識工具 (44) 電影與我 (2) 網路工具 (11) 踩雷系列 (4) 憑證 (1) 繁簡轉換 (2) Android (1) Azure (21) AzureFiles (2) AzureVM (2) Bitlocker (1) Certificate (1) Encrypt (1) Exchange (4) FSLogix (1) Hyper-V (13) Let'sEncrypt (14) LineBOT (14) MicrosoftExchange (3) MicrosoftOffice (5) MicrosoftOutlook (6) NintendoSwitch (1) PHP程式設計 (12) PowerShell (87) SoftEther (1) SQL (1) Teams (1) ubuntu (1) UPD (2) VBScript (19) VDI (23) Veeam (1) VMWare (1) VNC (1) VPN (3) WebServer (4) Windows10 (2) Windows8 (1) WindowsAD管理 (32) WindowsClient (17) WindowsServer (34) WorkFromHome (2) WVD (6) 時間排序 ►  2022 (18) ►  10月 (3) ►  9月 (6) ►  8月 (1) ►  7月 (1) ►  6月 (3) ►  5月 (1) ►  2月 (2) ►  1月 (1) ▼  2021 (33) ►  11月 (2) ►  10月 (2) ►  9月 (4) ►  8月 (1) ►  7月 (4) ►  6月 (6) ▼  5月 (4) PowerShellInvoke-WebRequest編碼問題(Bug5內容)(Big5) PowershellOut-File預設編碼UCS-2LEBOM問題(改成UTF-8) 用PowerShell取得自己的PublicIP 用PowerShell判斷時間區間後執行batch ►  2月 (3) ►  1月 (7) ►  2020 (39) ►  12月 (11) ►  11月 (9) ►  9月 (1) ►  8月 (1) ►  6月 (1) ►  5月 (12) ►  4月 (1) ►  3月 (1) ►  2月 (2) ►  2019 (14) ►  10月 (1) ►  9月 (1) ►  5月 (2) ►  3月 (5) ►  2月 (3) ►  1月 (2) ►  2018 (35) ►  12月 (2) ►  11月 (1) ►  10月 (1) ►  9月 (2) ►  8月 (3) ►  7月 (4) ►  6月 (9) ►  5月 (5) ►  3月 (6) ►  2月 (1) ►  1月 (1) ►  2017 (30) ►  12月 (4) ►  11月 (1) ►  9月 (1) ►  7月 (1) ►  5月 (2) ►  4月 (5) ►  3月 (3) ►  2月 (10) ►  1月 (3) ►  2016 (25) ►  12月 (5) ►  11月 (10) ►  10月 (5) ►  9月 (2) ►  7月 (2) ►  5月 (1) ►  2015 (5) ►  12月 (2) ►  10月 (2) ►  1月 (1) ►  2014 (10) ►  11月 (1) ►  10月 (1) ►  9月 (1) ►  7月 (1) ►  3月 (6) ►  2013 (31) ►  11月 (4) ►  10月 (2) ►  8月 (7) ►  7月 (15) ►  6月 (3) ►  2012 (13) ►  11月 (10) ►  4月 (1) ►  1月 (2) ►  2011 (3) ►  12月 (2) ►  11月 (1) ►  2010 (6) ►  11月 (1) ►  7月 (1) ►  2月 (1) ►  1月 (3) ►  2009 (16) ►  9月 (1) ►  7月 (3) ►  4月 (1) ►  3月 (3) ►  2月 (8) ►  2007 (23) ►  7月 (8) ►  5月 (9) ►  4月 (3) ►  3月 (2) ►  2月 (1) ►  2006 (2) ►  12月 (1) ►  10月 (1) ►  2005 (35) ►  11月 (1) ►  10月 (1) ►  8月 (2) ►  7月 (1) ►  6月 (10) ►  5月 (8) ►  4月 (1) ►  3月 (11) ►  2004 (36) ►  7月 (1) ►  6月 (1) ►  5月 (1) ►  3月 (3) ►  2月 (6) ►  1月 (24) ►  2003 (35) ►  12月 (4) ►  9月 (9) ►  8月 (11) ►  7月 (11)



請為這篇文章評分?