comp.lang.ada
 help / color / mirror / Atom feed
From: Alex // nytpu <nytpu@example.invalid>
Subject: Re: Ada 202x; 2022; and 2012 and Unicode package (UTF-nn encodings handling)
Date: Tue, 2 Sep 2025 13:13:12 -0600	[thread overview]
Message-ID: <1097fk8$mvl7$1@dont-email.me> (raw)
In-Reply-To: <1097br7$lh15$1@dont-email.me>

On 9/2/25 12:08 PM, Dmitry A. Kazakov wrote:
> The matter is quite straightforward:
Objectively false, "text" is never actually straightforward despite what 
it seems like on a surface level :P
> 1. Never ever use Wide and Wide_Wide. There is a marginal case of 
> Windows API where you need Wide_String for UTF-16 encoding. Otherwise, 
> use cases are absent. No text processing algorithms require code point 
> access.
Somewhat inclined to agree with Wide_<> but I don't see strong 
justification to *never* use Wide_Wide_<>, there's pretty substantial 
tradeoffs to both using UTF-32 and UTF-8 (in any programming language 
that supports both, but particularly with Ada's string situation) so 
unfortunately it ultimately falls on the programmer to understand and 
choose.
> 2. Use Character as octet. String as UTF-8 encoded.
Perfectly valid, explicitly mentioned as an option in my post.  Maybe 
actually would be better for most applications because they wouldn't 
need to transcode it, I should've noted that more clearly in my original 
response.  The only two issues: make sure to avoid the Latin-1 String 
routines unless you know you're doing is sound; and in older Ada 
versions I remember reading long debates about the String type may not 
be able to safely store UTF-8 on many compilers (of the era), but that 
issue was clarified by even Ada 95 IIRC.

I just personally prefer Wide_Wide_<> to get its slightly more 
Unicode-aware string routines, but it's not the only (or even inherently 
the best) option.

~nytpu

-- 
Alex // nytpu
https://nytpu.com/ - gemini://nytpu.com/ - gopher://nytpu.com/

  reply	other threads:[~2025-09-02 19:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-20 21:38 Ada 2012 and Unicode package (UTF-nn encodings handling) Yannick Duchêne (Hibou57)
2010-08-20 21:41 ` Yannick Duchêne (Hibou57)
2010-08-21  6:21 ` Dmitry A. Kazakov
2010-08-21  7:01 ` J-P. Rosen
2010-08-21  8:12   ` Yannick Duchêne (Hibou57)
2010-08-22 18:51     ` J-P. Rosen
2010-08-22 19:48       ` Georg Bauhaus
2010-08-22 20:40         ` J-P. Rosen
2010-08-23 10:32           ` Georg Bauhaus
2010-08-23 22:28 ` Randy Brukardt
2025-08-31 17:39 ` Ada 202x; 2022; and " Nicolas Paul Colin de Glocester
2025-08-31 21:23   ` Kevin Chadwick
2025-08-31 21:27     ` Nicolas Paul Colin de Glocester
2025-09-02 16:01   ` Alex // nytpu
2025-09-02 17:40     ` Nicolas Paul Colin de Glocester
2025-09-02 18:49       ` Keith Thompson
2025-09-02 19:27         ` Nicolas Paul Colin de Glocester
2025-09-02 20:02           ` Keith Thompson
2025-09-02 17:42     ` Nicolas Paul Colin de Glocester
2025-09-02 19:15       ` Alex // nytpu
2025-09-02 19:50         ` Nicolas Paul Colin de Glocester
2025-09-02 18:08     ` Dmitry A. Kazakov
2025-09-02 19:13       ` Alex // nytpu [this message]
2025-09-02 22:56     ` Lawrence D’Oliveiro
2025-09-03  0:20       ` Alex // nytpu
2025-09-03  4:10         ` Lawrence D’Oliveiro
2025-09-03 17:25           ` Alex // nytpu
replies disabled

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