Skip to content

Commit

Permalink
from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pubpub-zz committed Jun 22, 2024
1 parent 54fbcd7 commit fdbf37c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pypdf/_cmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,20 @@ def build_char_map_from_dict(
_predefined_cmap: Dict[str, str] = {
"/Identity-H": "utf-16-be",
"/Identity-V": "utf-16-be",
"/GB-EUC-H": "gbk", # TBC
"/GB-EUC-V": "gbk", # TBC
"/GBpc-EUC-H": "gb2312", # TBC
"/GBpc-EUC-V": "gb2312", # TBC
"/GBK-EUC-H": "gbk", # TBC
"/GBK-EUC-V": "gbk", # TBC
"/GB-EUC-H": "gbk",
"/GB-EUC-V": "gbk",
"/GBpc-EUC-H": "gb2312",
"/GBpc-EUC-V": "gb2312",
"/GBK-EUC-H": "gbk",
"/GBK-EUC-V": "gbk",
"/GBK2K-H": "gb18030",
"/GBK2K-V": "gb18030",
"/ETen-B5-H": "cp950",
"/ETen-B5-V": "cp950",
"/ETenms-B5-H": "cp950",
"/ETenms-B5-V": "cp950",
"/UniCNS-UTF16-H": "utf-16-be", # TBC
"/UniCNS-UTF16-V": "utf-16-be", # TBC
"/UniCNS-UTF16-H": "utf-16-be",
"/UniCNS-UTF16-V": "utf-16-be",
# UCS2 in code
}

Expand Down
7 changes: 7 additions & 0 deletions tests/test_cmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,10 @@ def test_ignoring_non_put_entries():
"""Issue #2290"""
reader = PdfReader(BytesIO(get_data_from_url(name="iss2290.pdf")))
reader.pages[0].extract_text()


@pytest.mark.enable_socket()
def test_eten_b5():
"""Issue #2356"""
reader = PdfReader(BytesIO(get_data_from_url(name="iss2290.pdf")))
reader.pages[0].extract_text().startswith("1/7 \n富邦新終身壽險")

0 comments on commit fdbf37c

Please sign in to comment.