xiaoyifang / goldendict-ng

The Next Generation GoldenDict
https://xiaoyifang.github.io/goldendict-ng/
Other
1.63k stars 89 forks source link

Dictionary info is not shown for a specific DSL dictionary #1250

Closed homocomputeris closed 11 months ago

homocomputeris commented 11 months ago

Describe the bug Dictionary info (name, languages) is not shown for this specific DSL dictionary (attached below). For other DSL dictionaries with the same structure and encoding the info is shown.

To Reproduce Steps to reproduce the behavior:

  1. Go to F3 dictionary list
  2. Select dictionary without name

Affected Dictionaries jpn-rus_Warodai.dsl.zip DSL UTF-8 with BOM LF

Expected behavior Show dictionari info: name, languages, etc.

Screenshots dsl_list

dsl

OS and software versions

Goldendict-ng 23.10.01-alpha.20231015.743226e5 Qt 6.5.2 Clang 14.0.3 (clang-1403.0.22.14.1) macos darwin 23.0.0 x86_64-little_endian-lp64 Flags:USE_XAPIAN MAKE_ZIM_SUPPORT MAKE_CHINESE_CONVERSION_SUPPORT NO_TTS_SUPPORT no_ffmpeg_player

shenlebantongying commented 11 months ago

Replace this tab with a space.

image

image

homocomputeris commented 11 months ago

Replace this tab with a space.

Doesn't change anything. Most DSLs are formatted using tabs in the preamble, which is according to the DSR spec, and are displayed just fine.

shenlebantongying commented 11 months ago

Yes, you are right.

Super weird, I just open the file and save as another file, then it will display correctly

Result after I re-save jpn-rus_Warodai.zip


I just figured out, re-saving will remove few bytes from the first line.

From EF BB BF EF BB BF to just EF BB BF, the original file contains two BOMs :sweat_smile: Re-save will remove duplicated BOM and it will work.

image

homocomputeris commented 11 months ago

From EF BB BF EF BB BF to just EF BB BF, the original file contains two BOMs

The dangers of downloading files from the internet 😅

Having some warning about bad encoding would be nice.