4

I want to insert the unicode character Thorn Þ into my document.

http://www.fileformat.info/info/unicode/char/00de/index.htm

The character seems to be inserted when I type

i<C-v>u00DE<esc>

But is displayed as the replacement character:

http://www.fileformat.info/info/unicode/char/fffd/index.htm

I assume this is because there is no glyph that vim can map to the unicode character. I am not sure how to proceed to update vim to get that character displayed correctly.

Note: This is different from the question marked as duplicate in that I already insert the correct unicode character. The problem is that it is not displayed correctly.

  • Not sure if this will fix your problem, but try this. – Tumbler41 Jun 6 '16 at 22:08
  • 4
    What do you get when you do :set enc? ? Also, are you using console vim or gvim? When I use gvim and :set enc=utf8 it works fine for me. – DJMcMayhem Jun 6 '16 at 23:17
  • Assuming Thorn is not outside the range of printable characters in the current encoding, you can (and probably should) use digraphs to insert special characters. See :h digraphs-use. The digraph for capital Thorn is TH. – Sato Katsura Jun 7 '16 at 7:10
4

The answer was posted in the comments by @DJ McMayhem.

:set enc?
latin-1

So by changing it to utf-8 the text becomes readable.

:set enc=utf-8
  • 1
    Aww, drat, I shoulda posted that as an answer. :P – DJMcMayhem Jun 7 '16 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.