ubuntu文本模式/终端中文乱码解决

中文乱码问题,记录一下

一、

1.Alt+Ctrl+F1 进入第一个终端tty1,发现中文乱码。 
2.安装zhcon。 
sudo apt-get install zhcon
3 输入下面命令,启动zhcon,中文显示正常。 
sudo zhcon --utf8 --drv=vga

==============================================没啥效果

二、

参考https://blog.csdn.net/lihe4151021/article/details/90048918

Ctrl+Alt+F1进入tty1界面
下载zhcon安装包
sudo apt-get install zhcon

需要将用户添加到添加到video组中
sudo adduser $(whoami) video  

注销当前用户,重新登录添加到video组的用户。然后,运行
zhcon --utf8
================================================

三、

参考https://blog.csdn.net/flywindmouse/article/details/13527769

fbterm--支持中文显示的控制台

-----------------------------------------------------------------------

       fbterm 提供了一个快速的终端仿真器,它直接运行在你的系统中的帧缓冲 (framebuffer) 之上。使用帧缓冲可以在终端渲染 UTF-8 文本时可以提高性能。fbterm 旨在提供国际化和现代字体支持时至少与 Linux 内核终端一样快。它允许你在同一个帧缓冲上创建多达 10 个不同的终端窗口,每个窗口都有它的回滚历史。

       要运行 fbterm,首先检查当前用户是否在 video 组,如不在,则加入。当运行 fbterm 后,会在用户主目录下生成 .fbtermrc 配置文件,其中可以更换字体样式及大小、默认前/背景色。


      若你不能看到中文,按 Ctrl+Alt+E 退出后,再运行下面的命令:
       LANG=zh_CN.utf-8 fbterm

-----------------------------------------------------------------------

1.下面我就安装了fbterm:

sudo apt-get install fbterm

2.安装完后,运行fbterm:

sudo fbterm

3.退出fbterm
在控制台中按 Ctrl+Alt + E 退出

4.当然fbterm功能是很强大的,支持字体样式、大小、样色设置等,修改配置文件.fbtermrc即可,在控制台输入以下命令:

sudo gedit ~/.fbtermrc

打开配置文件内容大致如下,可以根据需要做相应修改保存(然后重新启动fbterm:在控制台输入Ctrl+Alt+E 退出)则可:

---------------------------------

# Configuration for FbTerm


# Lines starting with '#' are ignored.
# Note that end-of-line comments are NOT supported, comments must be on a line of their own.


# font family names/pixelsize used by fbterm, multiple font family names must be seperated by ','
# and using a fixed width font as the first is strongly recommended
#font-names=Nokia Font YanTi
font-names=Monaco
font-size=15


# force font width (and/or height), usually for non-fixed width fonts
# legal value format: n (fw_new = n), +n (fw_new = fw_old + n), -n (fw_new = fw_old - n)
#font-width=
#font-height=


# default color of foreground/background text
# available colors: 0 = black, 1 = red, 2 = green, 3 = brown, 4 = blue, 5 = magenta, 6 = cyan, 7 = white
color-foreground=7
color-background=0


# max scroll-back history lines of every window, value must be [0 - 65535], 0 means disable it
history-lines=1000


# up to 5 additional text encodings, multiple encodings must be seperated by ','
# run 'iconv --list' to get available encodings.
text-encodings=


# cursor shape: 0 = underline, 1 = block
# cursor flash interval in milliseconds, 0 means disable flashing
cursor-shape=0
cursor-interval=500


# additional ascii chars considered as part of a word while auto-selecting text, except ' ', 0-9, a-z, A-Z
word-chars=._-


# change the clockwise orientation angle of screen display
# available values: 0 = 0 degree, 1 = 90 degrees, 2 = 180 degrees, 3 = 270 degrees
screen-rotate=0


# specify the favorite input method program to run
input-method=yong


# treat ambiguous width characters as wide
#ambiguous-wide=yes
 

 

 

发布了11 篇原创文章 · 获赞 6 · 访问量 1万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章