Gimp-Forum.net

Full Version: Scheme: reading Extended ASCII files
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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?
(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