Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scheme: reading Extended ASCII files
#1
Hello to all!

I am attempting to read Ascii files into Scheme. For some reason unknown to me, accented letters (ExtendedASCII) are ignored.

I am using the following statements:


Code:
(define inFile (open-input-file "E:/SomeFile.txt"))
(read inFile)
(read inFile) will properly read words with punctuation.

But lines like :

Lods: redevance féodale
Tourer: préparer pâte feuilletée 

will be read in as :

Lods: redevance fodale
Tourer: prparer pte feuillete 

Labelling of layers/channels/LayerGroups, in stand-alone scripts I have programmed, have shown no difficulties with accented letters.

What is missing from my code above?

Thanks in advance,

Nicolas Beaudet

P.S.
Gimp.2.8.22 / Windows 10 64-bit / Notepad++ as Script editor.
Reply
#2
One big question is the actual encoding of your file. Is it ISO-8859-15 (where the accented French characters are encoded in one byte) or UTF-8 (accented characters are encoded on two bytes).

See attached ZIP for

Code:
àa
éèêë
îï
ôö
ùûü
ç

using either encoding. More luck with one or the other?


Attached Files
.zip   encodings.zip (Size: 385 bytes / Downloads: 186)
Reply
#3
(10-03-2017, 03:37 PM)Ofnuts Wrote: One big question is the actual encoding of your file. Is it ISO-8859-15 (where the accented French characters are encoded in one byte) or UTF-8 (accented characters are encoded on two bytes).

See attached ZIP for

Code:
àa
éèêë
îï
ôö
ùûü
ç

using either encoding. More luck with one or the other?
Hi!
Converting the source file in UTF-8 has solved the reading of tokens!
Thank you so much.

Nicolas
Reply


Forum Jump: