X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=jmdict.cpp;fp=jmdict.cpp;h=2364ab5cea0512d4da040193dbfeb22052df0675;hb=afb81937a7df686f63cebaecfbc9e736f34f3608;hp=efbb7057db281569907c3c2831d56ae1a253b51a;hpb=a71285e3792f3c7326f3503275128e5aac180896;p=jmdict-cli.git diff --git a/jmdict.cpp b/jmdict.cpp index efbb705..2364ab5 100644 --- a/jmdict.cpp +++ b/jmdict.cpp @@ -161,7 +161,8 @@ void guessLanguage(const std::string& subject) { if (options::source == options::JAPANESE && !isUTF8) options::source = options::JAPANESE_ROMAJI; else if (options::source == options::UNKNOWN) - options::source = isUTF8 ? options::JAPANESE : options::NOT_JAPANESE; + // options::source = isUTF8 ? options::JAPANESE : options::NOT_JAPANESE; + options::source = isUTF8 ? options::JAPANESE : options::UNKNOWN; } int main(int argc, char** argv) @@ -180,8 +181,12 @@ try { fromJapanese(subject); else if (options::source == options::JAPANESE_ROMAJI) fromRomaji(subject); - else + else if (options::source == options::NOT_JAPANESE) + toJapanese(subject); + else { + fromRomaji(subject); toJapanese(subject); + } cout << entries << " match(es) found." << endl; return EXIT_SUCCESS;