Ticket #3260

Linuxで利用するとDBに入る番組表が文字化けする
Date d'ouverture: 2003-11-02 05:04 Dernière mise à jour: 2007-09-03 01:11

Rapporteur:
Propriétaire:
(Aucun)
Type:
État:
Atteints
Composant:
(Aucun)
Jalon:
(Aucun)
Priorité:
9 - le plus élevé
Sévérité:
5 - moyen
Résolution:
Aucun
Fichier:
Aucun

Détails

インターネットテレビガイドは、Shift JISでエンコードされ
ているみたいだが、Context-typeを見て漢字のエンコーディ
ングを行っていないため、LinuxのようにJava VMのdefault
エンコーディングが、Sift JISでない場合にDBに正しく番組表
が記録されない。
#Windowsでは、defaultエンコーディングが、Shift JISなので
ため問題なし。

本来は、インターネットテレビガイドから取って来たHTTP
レスポンスのContext-typeヘッタでエンコードを決めるべき。
しかし、Context-Typeを解釈するのには手間がかかるので、
とりあえずは、レスポンス全体をJISAutoDetectでエンコード
すれば、DBに正しい漢字コードで保存することができる。

Index:
jp/sourceforge/whitetable/util/iepg/IEPGProgramFactory.
java
=======================================================
============
RCS
file: /cvsroot/whitetable/src/jp/sourceforge/whitetable
/util/iepg/IEPGProgramFactory.java,v
retrieving revision 1.5
diff -u -r1.5 IEPGProgramFactory.java
---
jp/sourceforge/whitetable/util/iepg/IEPGProgramFactory.
java 18 May 2003 18:12:03 -0000 1.5
+++
jp/sourceforge/whitetable/util/iepg/IEPGProgramFactory.
java 1 Nov 2003 20:02:22 -0000
@@ -105,7 +104,13 @@
/** 文字列を解析してTVProgramオブジェクトを返しま
す。
*/
public TVProgram[] analyze(InputStream is) throws
WhiteTableException {
- return this.analyze(new InputStreamReader
(is));
+ try {
+ return this.analyze(new InputStreamReader
(is, "JISAutoDetect")); //TKYN
+ } catch (UnsupportedEncodingException e) {
+ throw new WhiteTableException(e);
+ } catch (WhiteTableException e) {
+ throw new WhiteTableException(e);
+ }
}

/**

Ticket History (2/2 Histories)

2003-11-02 05:33 Updated by: takuya-o
  • Priorité Update from 5 - moyen to 9 - le plus élevé
2007-09-03 01:11 Updated by: takuya-o
  • Ticket Close date is changed to 2007-09-03 01:11
  • État Update from Ouvert to Atteints

Attachment File List

No attachments

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion