comp.lang.ada
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* Re: Ada and Unicode
  @ 2022-04-03 18:37  7%           ` Thomas
  0 siblings, 0 replies; 3+ results
From: Thomas @ 2022-04-03 18:37 UTC (permalink / raw)


In article <s5n8nj$cec$1@franka.jacob-sparre.dk>,
 "Randy Brukardt" <randy@rrsoftware.com> wrote:

> "Luke A. Guest" <laguest@archeia.com> wrote in message 
> news:s5jute$1s08$1@gioia.aioe.org...
> >
> >
> > On 19/04/2021 13:52, Dmitry A. Kazakov wrote:
> >
> > > It is practical solution. Ada type system cannot express differently
> > represented/constrained string/array/vector subtypes. Ignoring Latin-1 and 
> > using String as if it were an array of octets is the best available 
> > solution.
> > >
> >
> > They're different types and should be incompatible, because, well, they 
> > are. What does Ada have that allows for this that other languages doesn't? 
> > Oh yeah! Types!
> 
> If they're incompatible, you need an automatic way to convert between 
> representations, since these are all views of the same thing (an abstract 
> string type). You really don't want 35 versions of Open each taking a 
> different string type.

i need not 35 versions of Open.
i need a version of Open with an Unicode string type (not Latin-1 - 
preferably UTF-8), which will use Ada.Strings.UTF_Encoding.Conversions 
as far as needed, regarding the underlying API.


> 
> It's the fact that Ada can't do this that makes Unbounded_Strings unusable 
> (well, barely usable).

knowing Ada, i find it acceptable.
i don't say the same about Ada.Strings.UTF_Encoding.UTF_8_String.

> Ada 202x fixes the literal problem at least, but we'd 
> have to completely abandon Unbounded_Strings and use a different library 
> design in order for for it to allow literals. And if you're going to do 
> that, you might as well do something about UTF-8 as well -- but now you're 
> going to need even more conversions. Yuck.

as i said to Vadim Godunko, i need to fill a string type with an UTF-8 
litteral.
but i don't think this string type has to manage various conversions.

from my point of view, each library has to accept 1 kind of string type 
(preferably UTF-8 everywhere),
and then, this library has to make needed conversions regarding the 
underlying API. not the user.


> 
> I think the only true solution here would be based on a proper abstract 
> Root_String type. But that wouldn't work in Ada, since it would be 
> incompatible with all of the existing code out there. Probably would have to 
> wait for a follow-on language.

of course, it would be very nice to have a more thicker language with a 
garbage collector, only 1 String type which allows all what we need, etc.

-- 
RAPID maintainer
http://savannah.nongnu.org/projects/rapid/

^ permalink raw reply	[relevance 7%]

* [ANN] UXStrings package available (UXS_20220226).
@ 2022-03-01 20:47  6% Blady
  0 siblings, 0 replies; 3+ results
From: Blady @ 2022-03-01 20:47 UTC (permalink / raw)


Hello,

The objective of UXStrings is Unicode and dynamic length support for 
strings in Ada.

UXStrings API is inspired from Ada.Strings.Unbounded in order to 
minimize adaptation work from existing Ada source codes.

Changes from last publication:
- Ada.Strings.UTF_Encoding.Conversions fix is no longer needed with GNAT 
CE 2021
- A few fix

Available on GitHub (https://github.com/Blady-Com/UXStrings) and also on 
Alire (https://alire.ada.dev/crates/uxstrings.html).

Feedback is welcome on actual use cases.

Regards, Pascal.

^ permalink raw reply	[relevance 6%]

* Re: Chess game in character over MS Windows
  @ 2019-03-01 13:17  5% ` manueledensenster
  0 siblings, 0 replies; 3+ results
From: manueledensenster @ 2019-03-01 13:17 UTC (permalink / raw)


On Friday, March 1, 2019 at 2:07:21 PM UTC+1, manueled...@gmail.com wrote:
> Hello,
> 
> I have inserted the 12 Wide_Character into a string of length 12 but gnatmake say at the exécution : length check failed.
> 
> Help me please.
> 
> 
> I have tested with UTF-8-auto-dos encoding with Emacs.
> 
> With GPS in UTF-8 is the same problem.
> 
> Thank you.

Sorry bis.
Ok, over MS Windows the problem is same over GPS or simple make with gnatmake and GtkAda.

My program is an chess game in text in a GtkAda project.
Sensibly the cocage of 12 Wide_Character is Ok.

But the Chess character are not printed.

I convert The literal Wide_Character with the line :

[code]

Locale_From_Utf8
		  
		  (Ada.Strings.UTF_Encoding.Conversions.Convert
		     ("" & Images(Piece_Type'Pos(Piece)),
		      UTF_8)
		  )
[/code]

To be inserted in gtk_text_buffer.

Thank you for your help.

^ permalink raw reply	[relevance 5%]

Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-03-01 13:07     Chess game in character over MS Windows manueledensenster
2019-03-01 13:17  5% ` manueledensenster
2021-04-17 22:03     Ada and Unicode DrPi
2021-04-19  9:08     ` Stephen Leake
2021-04-19 11:56       ` Luke A. Guest
2021-04-19 12:52         ` Dmitry A. Kazakov
2021-04-19 13:00           ` Luke A. Guest
2021-04-20 19:06             ` Randy Brukardt
2022-04-03 18:37  7%           ` Thomas
2022-03-01 20:47  6% [ANN] UXStrings package available (UXS_20220226) Blady

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox