"Pascal Obry" wrote in message news:4E9D87EB.6040203@obry.net... ... >> Now, if an implementation on Windows doesn't have a way to use UTF-8 >> encoding, that is an implementation problem, but not one that the >> Standard >> can do much about. > > But I can tell you that supporting UTF-8 on Windows is not trivial at all > as there is encoding/decoding needed in many places. Doing that is not > trivial and we had the need to invent the "encoding=[UTF8|8BITS]" mode for > Text_IO.Open for example. I would not claim that it is easy. I haven't done anything about it for Janus/Ada, for example. (This falls into the "no one has complained, so other things have priority" category). > As you say, implementation details, but can be easily defeated: > > If in my file I have: > > Filename : constant String := "�t�"; > > And this file is saved using UTF-8 encoding, then: > > Text_IO.Open (Filename, ..., Mode => "encoding=8bits"); > > Will just fail. A programmer error? Ok... Right. That's the problem with the weak-typing that we've adopted for UTF-8 and other encodings. It really has nothing to do with Open, it's a general problem with Ada.. The obvious solution (if this is a real problem in practice) would be to layer a strongly-typed layer on top of the existing facilities. Easy enough to do, but probably not something that will be in the Standard. > Now: > > Text_IO.Get (Filename, Last); > Text_IO.Open (Filename, ..., Mode => "encoding=8bits"); > > What if the console is UTF-8? If you're expecting to get Wide_Wide_Characters, you really ought to read a Wide_Wide_Character string. But I'm well aware that this solution is sub-optimal (especially in that it wastes huge amounts of space). Short of completely abandoning the existing I/O system (not the worst idea, IMHO, but unlikely), I don't think there is any practical way to "fix" Ada to deal easily with the *rare* possibility of non-Latin-1 characters. If I was doing this from scratch, I would simply decree that all I/O strings are represented in UTF-8, and use a dedicated type for them so that they can't be mixed with "String" or "Wide_String". Randy.