LaTeX forum ⇒ 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)
Posts: 7
Joined: Thu Mar 23, 2017 9:54 pm

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

Postby yurica » Mon Sep 11, 2017 8:50 pm

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:

  1. \lstinputlisting[language=scilab]{./codescilab/ex01angulo.sce}

for example, my Scilab code is being showed like that:

  1. //limpando a memoria e o console do scilab
  2. clear;
  3. clc;
  5. //constante pi
  6. pi = 3.141592;
  8. //os comandos printf, mprintf e disp escrevem no console
  9. mprintf("Programa para converter graus decimais em radianos. \n\n");
  11. //nao é necessário declarar uma variável e seu tipo
  12. ang = input("Digite um angulo em graus decimais: ");
  14. //transformando o angulo em radianos
  15. rad = ang*(pi)/(180);
  17. //escrevendo o resultado no console
  18. 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.



User avatar
Site Moderator
Posts: 3724
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Sep 12, 2017 7:19 am

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.

Return to “Fonts & Character Sets”

Who is online

Users browsing this forum: No registered users and 1 guest