我是一名 IT 开发人员,出于某种原因,我需要在报告中使用 JSON 和 XML,但使用阿拉伯语。
对于 JSON 和 XML 环境我使用这个:
\documentclass{report}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}
\usepackage{url}
\usepackage{lmodern}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{arabtex}
\usepackage{listings}
\usepackage{xcolor}
\colorlet{punct}{red!60!black}
\definecolor{background}{HTML}{EEEEEE}
\definecolor{delim}{RGB}{20,105,176}
\colorlet{numb}{magenta!60!black}
\lstdefinelanguage{json}{
basicstyle=\normalfont\ttfamily,
numbers=left,
numberstyle=\scriptsize,
stepnumber=1,
numbersep=8pt,
showstringspaces=false,
breaklines=true,
frame=lines,
backgroundcolor=\color{background},
literate=
*{0}{{{\color{numb}0}}}{1}
{1}{{{\color{numb}1}}}{1}
{2}{{{\color{numb}2}}}{1}
{3}{{{\color{numb}3}}}{1}
{4}{{{\color{numb}4}}}{1}
{5}{{{\color{numb}5}}}{1}
{6}{{{\color{numb}6}}}{1}
{7}{{{\color{numb}7}}}{1}
{8}{{{\color{numb}8}}}{1}
{9}{{{\color{numb}9}}}{1}
{:}{{{\color{punct}{:}}}}{1}
{,}{{{\color{punct}{,}}}}{1}
{\{}{{{\color{delim}{\{}}}}{1}
{\}}{{{\color{delim}{\}}}}}{1}
{[}{{{\color{delim}{[}}}}{1}
{]}{{{\color{delim}{]}}}}{1},
}
并制作如下文本:
\begin{document}
\chapter*{Preambule}
\begin{lstlisting}[language=json,firstnumber=1]
<reversegeocode timestamp="Sun, 19 Jan 20 11:23:54 +0000" attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright" querystring="format=xml&lat=36.77618515&lon=3.05828603472308&zoom=18&addressdetails=1">
<result place_id="169689605" osm_type="way" osm_id="355559012" ref="Place Emir Abdelkader" lat="36.77618515" lon="3.05828603472308" boundingbox="36.7760136,36.7763549,3.0581641,3.0584054">
Place Emir Abdelkader, ساحة الامير عبد القادر, Alger Centre, Daïra Sidi M'Hamed, Alger, Algérie
</result>
<addressparts>
<address29>Place Emir Abdelkader</address29>
<road>ساحة الامير عبد القادر</road>
<town>Alger Centre</town>
<county>Daïra Sidi M'Hamed</county>
<state>Alger</state>
<country>Algérie</country>
<country_code>dz</country_code>
</addressparts>
</reversegeocode>
\end{lstlisting}
\end{document}
我的问题是阿拉伯语文本将显示为????????
如何解决这个问题?