Detect mecab encoding.

Detect which dictionary encoding to use instead of hard-coding euc-jp.