------- Comment #2 from burnus at gcc dot gnu dot org  2010-08-04 12:39 -------
Created an attachment (id=21393)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21393&action=view)
Support -finput-charset=  (accepts option, but does not fix the issue)

This patch allows the -finput-charset= but it does not fix the actual problem.


scanner.c has: load_line, which works with wide strings, but gets the letters
via getc(). Maybe one could implement UTF-8 reading for strings in scanner.c -
and use libcpp (-cpp) to convert the input encoding to UTF-8, if it isn't
UTF-8.

http://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libgfortran/io/read.c;hb=HEAD#l236


If one uses CPP, one probably needs to set (internally) wide_charset to UTF-8
such that CPP outputs UTF-8.


Possible work plan:

a) if -finput-charset= is used but CPP is not used: Allow UTF-8 but print an
error for other encodings. Read internally as UTF-8.

b) if -finput-charset= is used with -cpp: Allow it and set exec encoding (or
whatever it is called) to UTF-8 such that libcpp returns an UTF-8 string to
gfortran

c) By default continue to use the current means of input, i.e. a simple getc.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45179

Reply via email to