RFC Wide Characters in I/O

FX fxcoudert@gmail.com
Fri May 16 20:15:00 GMT 2008


> What about kind=2, do we have that?

No, and I don't think we have any compelling need for it in the future.

>>> If the user has specified an ENCODING="default" and the kind is  
>>> 1, we do what we do now and transfer as 8bit (mostly ASCII).  If  
>>> kind is greater than 1, I suggest we transfer each byte as is.   
>>> So for kind=4, we would transfer 4 bytes. This would enable doing  
>>> some packed 4x1 byte character stuff.  I think the standard would  
>>> allow this and thats why "default" is so loosely defined.
>> I think you're right, but maybe that's a point that could be  
>> raised on
>> c.l.f.
>
> Yes, we need to ask.

For the record, my opinion is that in that case, we should transfer  
one byte as a simple (unsigned char) and simply cast it into a wide  
character. This makes it possible to read ASCII file into character 
(kind=4) variables, and also makes it more symmetric with the case of  
kind=1 and encoding=UTF-8.

FX

-- 
François-Xavier Coudert
http://www.homepages.ucl.ac.uk/~uccafco/



More information about the Fortran mailing list