Gimp-Forum.net
Scheme: reading Extended ASCII files - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+--- Thread: Scheme: reading Extended ASCII files (/Thread-Scheme-reading-Extended-ASCII-files)



Scheme: reading Extended ASCII files - nbeaudet - 10-03-2017

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.


RE: Scheme: reading Extended ASCII files - Ofnuts - 10-03-2017

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?


RE: Scheme: reading Extended ASCII files - nbeaudet - 10-03-2017

(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