Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Output not displaying properly #7

Open
SpongebobSquamirez opened this issue Nov 18, 2018 · 2 comments
Open

Output not displaying properly #7

SpongebobSquamirez opened this issue Nov 18, 2018 · 2 comments

Comments

@SpongebobSquamirez
Copy link

I'm not sure what format this is being outputted to, but when I view it in notepad++ it says it's UCS 2 LE BOM. When I convert it to UTF-8 nothing changes, and when I use SHIFT-JIS it gives Japanese characters but it's all nonsense.

I've attached an excerpt of my output, as well as another file showing the original entries from that excerpt for two headwords I was able to track down.

Excerpt:

{
"charCode": "jisx0208",
"discCode": "epwing",
"subbooks": [
{
"title": "三省堂 スーパー大辞林",
"copyright": " \n       ●三省堂 スーパー大辞林 CD−ROM●\n \n       <収録書名>\n \n       『大辞林 第2版』\n        編者  松村 明・三省堂編修所\n             {{w_44663}}1995\n \n        『デイリーコンサイス英和辞典 第5版』\n        編者 三省堂編修所\n            {{w_44663}}1990\n \n       『デイリーコンサイス和英辞典 第4版』\n        編者 三省堂編修所\n            {{w_44663}}1990\n \n       『三省堂 ワープロ漢字辞典』\n        編者 三省堂編修所\n            {{w_44663}}1986\n \n        発行者 株式会社 三省堂\n \n        *このCD−ROMに収録されているデータは、著作権法により\n         保護されており、無断で転載・複写することはできません。\n",
"entries": [
{
"heading": "しょ-り【書吏】",
"text": "しょ-り [1] 【書吏】\n(1)律令制で,四品以上の親王・内親王および三位以上の公卿に仕えた職員。文案の起稿・筆録をつかさどった。\n(2)「胥吏(シヨリ){(2)}」に同じ。\n"
},
{
"heading": "しょり【処理】(和英)",
"text": "しょり【処理】\ndisposition;→英和\nmanagement;→英和\ntransaction;treatment.→英和\n〜する manage;→英和\ndispose;→英和\ntreat.→英和\n"
},
{
"heading": "ジョリオ-キュリー{{w_44666}}Fr{{n_49447}}d{{n_49447}}ric Joliot-Curie{{w_44667}}",
"text": "ジョリオ-キュリー {{w_44666}}Fr{{n_49447}}d{{n_49447}}ric Joliot-Curie{{w_44667}}\n(1900-1958) フランスの物理学者・平和運動家。キュリー夫妻の長女イレーヌの夫。夫妻で人工放射能を発見。第二次大戦中はナチスに対する抵抗運動に参加,戦後は平和運動に積極的に参加。世界平和評議会議長。\n"
},
{
"heading": "りふ【利府】",
"text": "りふ 【利府】\n宮城県中部,宮城郡の町。仙台市の北に接し,松島湾に臨む。石巻街道の宿駅として発達。梨の産地。\n"
},
{
"heading": "πüÿπéçπéè-πüÿπéçπéè",
"text": "じょり-じょり [1] (副)\n髪やひげなどを剃(ソ)る音を表す語。\n"
},
{
"heading": "しょ-りゅう【庶流】",
"text": "しょ-りゅう ―リウ [0] 【庶流】\n(1)庶子の系統。庶族。庶系。\n⇔嫡流\n(2)本家から分家した家筋。分家。別家。\n"
},
{
"heading": "しょ-りゅう【諸流】",
"text": "しょ-りゅう ―リウ [1] 【諸流】\nさまざまの流派。\n"
},
{
"heading": "じょ-りゅう【女流】",
"text": "じょ-りゅう ヂヨリウ [0] 【女流】\n女性。婦人。「―棋士」「―文学」\n"
},
{
"heading": "じょ-りゅう【叙留】",
"text": "じょ-りゅう ―リウ 【叙留】\n律令制下,位階だけ昇進し,官職はもとのままにとどまること。\n"
},
{
"heading": "じょりゅう【女流(の)】(和英)",
"text": "じょりゅう【女流(の)】\na woman;→英和\na female;→英和\na lady.→英和\n"
},
{
"heading": "かみかぜ【神風】(和英)",
"text": "かみかぜ【神風】\n(1) a divine wind;the timely rescue of Providence.(2) a Kamikaze;a suicide pilot (特攻隊員).\n‖神風運転手 a reckless driver.\n"
},
{
"heading": "うんてん-しゅ【運転手】",
"text": "うんてん-しゅ [3] 【運転手】\n電車・自動車などの運転をする人。\n"
}
]
}
]
}

Original Entries:

{
"heading": "かみかぜ【神風】(和英)",
"text": "かみかぜ【神風】\n(1) a divine wind;the timely rescue of Providence.(2) a Kamikaze;a suicide pilot (特攻隊員).\n‖神風運転手 a reckless driver.\n"
}

かみかぜ【神風】(和英)
かみかぜ【神風】
(1) a divine wind;the timely rescue of Providence.(2) a Kamikaze;a suicide pilot (特攻隊員).
‖神風運転手 a reckless driver.

{
"heading": "うんてん-しゅ【運転手】",
"text": "うんてん-しゅ [3] 【運転手】\n電車・自動車などの運転をする人。\n"
}

うんてん-しゅ【運転手】
うんてん-しゅ [3] 【運転手】
電車・自動車などの運転をする人。

@FooSoft
Copy link
Owner

FooSoft commented Nov 20, 2018

So literally all the EPWING dictionaries I've seen before were encoded in EUC-JP, but it looks like you've found one that isn't! This is probably the problem here:
https://github.com/FooSoft/zero-epwing/blob/master/convert.c#L119

It should probably dynamically pick an encoding based on the charCode value...

@SpongebobSquamirez
Copy link
Author

I looked on Wikipedia and also here: https://stackoverflow.com/questions/1778619/encoding-conversion-from-jis-x-208-to-unicode
but I'm not sure what's the best thing to use. I'm not sure #1 what the right encoding is, and #2 what the character set for it is written as in C. If it's like SHIFT_JIS/SHIFT-JIS, I could try changing that, but I don't really want to build this thing (by the way, I'm on Windows).

Also, all my dictionaries give the same type of result. I tried 大辞林, 新明解, 大辞泉, 新辞林, 明鏡, etc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants