Console logging output can not display non-ASCII charactors correctly
See original GitHub issueType of JetBrains IDE (IntelliJ, PyCharm, etc.) and version
pycharm pro 2021.2.3
Operating System
Windows11 Pro 21H2 Chinese version ()
TeXiFy IDEA version
0.7.12
What I did (steps to reproduce)
Minimal example to reproduce the problem
file 1. main.tex
\documentclass{article}
\usepackage{ctex} % the package ctex is for chinese output
\begin{document}
\cite{测试test} % add a cite with non-ASCII charactor
\bibliographystyle{plain}
\bibliography{bibfile}
\end{document}
file 2. bibfile.bib
@phdthesis{测试test,
title = {测试test}
}
use engine latexmk with -xelatex to compile, and all file is in utf-8 encoding.
Expected behavior
the warning should be show like LaTeX Warning: Citation `测试test’ on page 1 undefined on input line 4.

Actual behavior
But it shows LaTeX Warning: Citation `娴嬭瘯test’ on page 1 undefined on input line 4.
and 娴嬭瘯 is 测试 display in error encoding, it should display in utf-8, but actually it display in GBK.
What’s more
It’s a encoding error, Windows in Chinese use GBK as its default encoding, but I set UTF-8 in pycharm and Windows
set UTF-8 as default encoding with cmd and programs
Use cmd or powershell to complie the tex file, the logging will not display in error encoding.
And others in pycharm like python output non-ASCII charactors in console is correct.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7

Top Related StackOverflow Question
Okay I installed the kaiti and simhei fonts and can reproduce the problem on Windows, and for me it looks even worse:
but I think I found a solution: go to Help > Edit custom VM options, add
-Dfile.encoding=UTF-8and restart PyCharm. Does that solve it for you as well?If it works, we should definitely add this to the wiki.
I didn’t know Windows had any components that are not legacy 😆
Added it to the wiki: https://github.com/Hannah-Sten/TeXiFy-IDEA/wiki/Unicode
别客气!