public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45179] Support UTF-8 (and other encodings) in the source file (.f90) for CHARACTER(kind=4)
       [not found] <bug-45179-4@http.gcc.gnu.org/bugzilla/>
@ 2014-05-04 14:14 ` dominiq at lps dot ens.fr
  0 siblings, 0 replies; 3+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-05-04 14:14 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-05-04
     Ever confirmed|0                           |1

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Still present at r210049.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/45179] Support UTF-8 (and other encodings) in the source file (.f90) for CHARACTER(kind=4)
  2010-08-04 10:16 [Bug fortran/45179] New: " burnus at gcc dot gnu dot org
  2010-08-04 10:19 ` [Bug fortran/45179] " burnus at gcc dot gnu dot org
@ 2010-08-04 12:39 ` burnus at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-08-04 12:39 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/45179] Support UTF-8 (and other encodings) in the source file (.f90) for CHARACTER(kind=4)
  2010-08-04 10:16 [Bug fortran/45179] New: " burnus at gcc dot gnu dot org
@ 2010-08-04 10:19 ` burnus at gcc dot gnu dot org
  2010-08-04 12:39 ` burnus at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-08-04 10:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2010-08-04 10:19 -------
Created an attachment (id=21392)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21392&action=view)
Test case in UTF-8 encoding

Compile with:
  gfortran -cpp -finput-charset=UTF-8 wide.f90

Expected output:
  Hello World = &#20320;&#22909;
  &#20320;&#22909;

Currently, the second line is wrong; the two Chinese characters Ni (you) and
Hao (good) [ni hao = hello, good morning/afternoon] are split into six one-byte
characters as len() shows.


-- 


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-04 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-45179-4@http.gcc.gnu.org/bugzilla/>
2014-05-04 14:14 ` [Bug fortran/45179] Support UTF-8 (and other encodings) in the source file (.f90) for CHARACTER(kind=4) dominiq at lps dot ens.fr
2010-08-04 10:16 [Bug fortran/45179] New: " burnus at gcc dot gnu dot org
2010-08-04 10:19 ` [Bug fortran/45179] " burnus at gcc dot gnu dot org
2010-08-04 12:39 ` burnus at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).