0fnt
0fnt

Reputation: 8681

Linux and unicode

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 .

Linux ❤ Unicode

I saved a japanese character in a file, and opening it in multiple ways gives me multiple results.

Counterclockwise (roughly)

  1. 'cat' inside yakuake shows me the right results.
  2. vim inside yakuake doesn't show it right!
  3. gvim opened from yakuake shows it wrong too. (Bigger gvim in center of screen)
  4. gvim opened from Alt-F2 shows it right, bottom gvim.
  5. Intellij opening it directly shows it right. (not in image)
  6. Reading using scala in Intellij shows it wrong. 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

Answers (1)

0fnt
0fnt

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

Related Questions