No Defaulting to UTF-8 in StartDocumentEventImpl#getCharacterEncodingScheme() without XML-Declaration

オープン
#13 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
java
領域
api

調査の方向性

org.codehaus.stax2.ri.evt.StartDocumentEventImpl#getCharacterEncodingScheme() と XMLStreamReader の値からの構築から始めます。その動作を javax.xml.stream.events.StartDocument の契約と比較します。XML 宣言のないドキュメントが UTF-8 を報告し、宣言されたエンコーディングが変更されない状態になれば完了です。

索引モデルが issue の本文から書いたものです。

説明

A org.codehaus.stax2.ri.evt.StartDocumentEventImpl instance is constructed from the values in a XMLStreamReader instance.

The member variable mEncodingScheme is set from the reader-function #getCharacterEncodingScheme(). JavaDoc of that function:

Returns the character encoding declared on the xml declaration Returns null if none was declared

If there is no xml declaration in the document, mEncodingScheme will be null. In XML 1.0 a xml declaration SHOULD be present, but is not required.

The JavaDoc of javax.xml.stream.events.StartDocument, the interface which is implemented defines the return value of the #getCharacterEncodingScheme()-function as follows:

the character encoding, defaults to "UTF-8"

org.codehaus.stax2.ri.evt.StartDocumentEventImpl#getCharacterEncodingScheme() returns the memberVariable mEncodingScheme, which is null when the XML has no xml declaration. I would expect the default value UTF-8.

主要言語
Java
スター
42
フォーク
21
平均マージ
3時間 50分
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

FasterXML/stax2-api のほかの issue

FasterXML/stax2-api の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。