Skip to content

Commit

Permalink
Merge pull request #69 from kotaro-kinoshita/fix/support-bom
Browse files Browse the repository at this point in the history
Fix/support bom
  • Loading branch information
kotaro-kinoshita authored Dec 30, 2024
2 parents a0e83d7 + 7400d01 commit 34f364f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ yomitoku ${path_data} -f md -o results -v --figure --lite
- `--ignore_line_break` 画像の改行位置を無視して、段落内の文章を連結して返します。(デフォルト:画像通りの改行位置位置で改行します。)
- `--figure_letter` 検出した図表に含まれる文字も出力ファイルにエクスポートします。
- `--figure` 検出した図、画像を出力ファイルにエクスポートします。(html と markdown のみ)
- `--encoding` エクスポートする出力ファイルの文字エンコーディングを指定します。サポートされていない文字コードが含まれる場合は、その文字を無視します。(utf-8, shift-jis, enc-jp, cp932)
- `--encoding` エクスポートする出力ファイルの文字エンコーディングを指定します。サポートされていない文字コードが含まれる場合は、その文字を無視します。(utf-8, utf-8-sig, shift-jis, enc-jp, cp932)

その他のオプションに関しては、ヘルプを参照

Expand Down
2 changes: 1 addition & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ yomitoku ${path_data} -f md -o results -v --figure
- `--ignore_line_break`: Ignores line breaks in the image and concatenates sentences within a paragraph. (Default: respects line breaks as they appear in the image.)
- `--figure_letter`: Exports characters contained within detected figures and tables to the output file.
- `--figure`: Exports detected figures and images to the output file (supported only for html and markdown).
- `--encoding` Specifies the character encoding for the output file to be exported. If unsupported characters are included, they will be ignored. (utf-8, shift-jis, enc-jp, cp932)
- `--encoding` Specifies the character encoding for the output file to be exported. If unsupported characters are included, they will be ignored. (utf-8, utf-8-sig, shift-jis, enc-jp, cp932)


For other options, please refer to the help documentation.
Expand Down
2 changes: 1 addition & 1 deletion docs/usage.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ yomitoku ${path_data} -f md -o results -v
- `--ignore_line_break`: Ignores line breaks in the image and concatenates sentences within a paragraph. (Default: respects line breaks as they appear in the image.)
- `--figure_letter`: Exports characters contained within detected figures and tables to the output file.
- `--figure`: Exports detected figures and images to the output file (supported only for html and markdown).
- `--encoding` Specifies the character encoding for the output file to be exported. If unsupported characters are included, they will be ignored. (utf-8, shift-jis, enc-jp, cp932)
- `--encoding` Specifies the character encoding for the output file to be exported. If unsupported characters are included, they will be ignored. (utf-8, utf-8-sig, shift-jis, enc-jp, cp932)


**NOTE**
Expand Down
2 changes: 1 addition & 1 deletion docs/usage.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ yomitoku ${path_data} -f md -o results -v
- `--ignore_line_break` 画像の改行位置を無視して、段落内の文章を連結して返します。(デフォルト:画像通りの改行位置位置で改行します。)
- `--figure_letter` 検出した図表に含まれる文字も出力ファイルにエクスポートします。
- `--figure` 検出した図、画像を出力ファイルにエクスポートします。(html と markdown のみ)
- `--encoding` エクスポートする出力ファイルの文字エンコーディングを指定します。サポートされていない文字コードが含まれる場合は、その文字を無視します。(utf-8, shift-jis, enc-jp, cp932)
- `--encoding` エクスポートする出力ファイルの文字エンコーディングを指定します。サポートされていない文字コードが含まれる場合は、その文字を無視します。(utf-8, utf-8-sig, shift-jis, enc-jp, cp932)

その他のオプションに関しては、ヘルプを参照

Expand Down
9 changes: 7 additions & 2 deletions src/yomitoku/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@


def validate_encoding(encoding):
if encoding not in ["utf-8", "shift-jis", "euc-jp", "cp932"]:
if encoding not in [
"utf-8",
"utf-8-sig",
"shift-jis",
"euc-jp",
"cp932",
]:
raise ValueError(f"Invalid encoding: {encoding}")

return True


Expand Down

0 comments on commit 34f364f

Please sign in to comment.