iconv
文字コードを変換して出力する
nkf コマンドも見てみる
whois を正常に出してみる
文字化け確認
$ whois google.jp Domain Information: [B%I%a%$%s>pJs] [Domain Name] GOOGLE.JP [BEPO?<TL>] Google Inc. [Registrant] Google Inc. [Name Server] ns1.google.com [Name Server] ns2.google.com [Name Server] ns3.google.com [Name Server] ns4.google.com [Signing Key] [BEPO?G/7nF|] 2005/05/30 [BM-8z4|8B] 2015/05/31 [B>uBV] Active [B:G=*99?7] 2014/06/01 01:05:11 (JST) Contact Information: [B8x3+O"MmAk8}] [BL>A0] Google Inc. [Name] Google Inc. [Email] dns-admin@google.com [Web Page] [BM9JXHV9f] 94043 [B=;=j] Mountain View 1600 Amphitheatre Parkway US [Postal Address] Mountain View 1600 Amphitheatre Parkway US [BEEOCHV9f] 16502530000 [FAXBHV9f] 16502530001
変換
$ whois google.jp | iconv -f iso-2022-jp -t utf8 Domain Information: [ドメイン情報] [Domain Name] GOOGLE.JP [登録者名] Google Inc. [Registrant] Google Inc. [Name Server] ns1.google.com [Name Server] ns2.google.com [Name Server] ns3.google.com [Name Server] ns4.google.com [Signing Key] [登録年月日] 2005/05/30 [有効期限] 2015/05/31 [状態] Active [最終更新] 2014/06/01 01:05:11 (JST) Contact Information: [公開連絡窓口] [名前] Google Inc. [Name] Google Inc. [Email] dns-admin@google.com [Web Page] [郵便番号] 94043 [住所] Mountain View 1600 Amphitheatre Parkway US [Postal Address] Mountain View 1600 Amphitheatre Parkway US [電話番号] 16502530000 [FAX番号] 16502530001