------- Comment #4 from fxcoudert at gcc dot gnu dot org  2008-04-15 20:53 
-------
(In reply to comment #3)
> Actually, I do not understand how to write things like 
>    character(kind=myUCS4,len=20) :: foo = myUCS4_'Some UCS4 string'

Ah, I'm glad that I'm not alone! I was thinking of asking advice on c.l.f when
I get some time to write. I agree with you that it is not clear at all.

> (The problem is switching the encoding within the same file; good luck in
> finding an editor which supports this.)

I don't think there is such thing as a file with multiple encodings, and we
shouldn't create such a beast just for Fortran.

> a) Have a UCS-4 input file; then both default_'foo' and ucs4_'foo' work.

I'd suggest going for that.

> b) Expect that for myUCS4_'foo' literals the characters in the quotes are
> actually UTF-8.

See above, I don't think we want to mix encodings. But, we can support both (a)
and (b): if the file is UCS4, go for (a), if the file is UTF-8, go for (b).

On a personal note, I would use (b) more than (a): UTF-8 is the way forward,
and fixed-width encodings are a real pain for file representation (which is
different than internal representation).

> Otherwise, I think Fortran misses a good way of inputting non-ascii characters
> in an ASCII file. C99 offers '\uXXXX'

We already have -fbackslash, I can see us accepting that kind of code with a
given option; it would really be useful.


-- 


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

Reply via email to