Fonts & Character SetsAccents not showing with \lstinputlisting command for Scilab codes (ISO-UTF8)

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
yurica
Posts: 7
Joined: Thu Mar 23, 2017 9:54 pm

Accents not showing with \lstinputlisting command for Scilab codes (ISO-UTF8)

Post by yurica »

Hello LaTeX Community!

I am writing a Scilab book in Portuguese language using ISO-8859-1 character encoding. However, all my Scilab codes are written in UTF-8 encoding. So when I write:

Code: Select all

\lstinputlisting[language=scilab]{./codescilab/ex01angulo.sce}
for example, my Scilab code is being showed like that:

Code: Select all

//limpando a memoria e o console do scilab 
clear;
clc;

//constante pi
pi = 3.141592;

//os comandos printf, mprintf e disp escrevem no console
mprintf("Programa para converter graus decimais em radianos. \n\n");

//nao é necessário declarar uma variável e seu tipo
ang = input("Digite um angulo em graus decimais: ");

//transformando o angulo em radianos
rad = ang*(pi)/(180);

//escrevendo o resultado no console
printf("%f graus corresponde a %f radianos",ang,rad);
The accents are not working.

In sum: All the accents work perfectly on all my texts due to the ISO-8859-1 encoding. Just the codes that come from a .sce (Scilab) file have those weird symbols instead of the accents. How can I solve that problem? Thanks in advance.

Regards.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Accents not showing with \lstinputlisting command for Scilab codes (ISO-UTF8)

Post by Johannes_B »

Have a look at listings-utf8.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply