Hello everyone it’s me candle.
In this time I will show you how to fix emacs powerline character corruption(mojibake).
I am referring to this site.
I will explain both iterm2 and mac standard terminal.
You use emacs
Your emacs was installed powerline.
You use emacs with iTerm2 or mac standard terminal.
Install the font supporting powerline
The fundamental problem of this character corruption arises from the thing that the character of unicode used by powerline doesn’t contain the font in your terminal.
Let’s install necessary fonts.
There is a font supporting to powerline in github.
We clone this repository. The place is ok anywhere.
I clone it to Desktop.
cd ~/Desktop/ git clone https://github.com/powerline/fonts.git
Installation of font
You may want to install all fonts, but the font file is big, so we would like to install only one.
You can check the kind of fonts from this github page.
Anyway let’s install one.
Hmm we will install “SourceCodePro”.
Execute install.sh in the cloned fonts folder.
If you pass the font name to the first argument, you can install only the font of your choice.
cd ~/Desktop/fonts ./install.sh "Source Code Powerline Regular"
Installation of font is finish.
I explain how to setup each
Since the font settings are different for the software, I will explain each.
Setup font in Iterm2
Launch Iterm2 and select “preferences…” from “iTerm2” of the top menu.
Choose “Profiles” and select the tab of “Text”.
Choose “Change Font” of “Non-ASCII Font” in the red range of the below image.
And you select the “Source code pro for powerline” we installed before.
Non-ASCII Font is a type of font other than standard characters.
powerline’s corruption character uses the font which is specified here.
If you want to use the “Source Code Pro for Powerline” font as a whole of iTerm2, you also change the “Font” of the blue range please.
Mac standard terminal font configuration
Launch the terminal, select the “Terminal” at the top of menu and next “Preferences…”.
Choose the “Change…” in the “Text” tab in the “Profiles”
Mac standard terminal can not make only special characters powerline font like iTerm2.
You use the same font in the whole of terminal.
You choose the “Source Code Pro for Powerline”
Font configuration is over.
iLaunch Emacs with iTerm2
Also it is ok.
Now you can have a beautiful powerline life.