Reputation: 8681
I know (or I think I know) about char encoding unicode as much as is in this article: http://www.joelonsoftware.com/articles/Unicode.html .
I saved a japanese character in a file, and opening it in multiple ways gives me multiple results.
Counterclockwise (roughly)
scala.io.Source.fromFile( , "UTF-8" ).mkString
Could someone tell me please what's up here? Specially the vim inconsistency? I can bear Linux(X) and Intellij behaving arbitrarily, but vim doing that tells me that it's my understanding that's faulty.
EDIT: To answer @user3666209's question, all the vim/gvim's have 'empty' file encoding.
Upvotes: 0
Views: 153
Reputation: 8681
Thank you everyone who answered!
Reasons of vim inconsistency, wrong 'encoding' for vims open from terminal and separately. Solved by :set encoding=utf8 inside vim.
Also set my terminal's encoding to utf8 otherwise cat would give wrong results.
For java, use export JAVA_TOOL_OPTIONS='-Dfile.encoding=UTF-8'
Upvotes: 1