--  Unicode text, Ada's way (D171): Wide_Wide_String holds code points (here 13), literals
--  beyond Latin-1 are its, UTF-8 goes out through Ada.Wide_Wide_Text_IO and converts both
--  ways with Ada.Strings.UTF_Encoding; a wide character's image in a String is GNAT's.
with Ada.Text_IO;
with Ada.Wide_Wide_Text_IO;
with Ada.Strings.UTF_Encoding.Wide_Wide_Strings;
procedure Main is
   use Ada.Strings.UTF_Encoding.Wide_Wide_Strings;
   Greeting : constant Wide_Wide_String := "こんにちは, 世界 ✓ é";
   Word : Wide_Wide_String (1 .. 3) := "abc";
   Bytes : constant String := Encode (Greeting);
begin
   pragma Assert (Greeting'Length = 13);
   Word (2) := '語';
   pragma Assert (Word = "a語c");
   Ada.Wide_Wide_Text_IO.Put_Line (Greeting);
   Ada.Wide_Wide_Text_IO.Put_Line (Decode (Bytes));
   Ada.Wide_Wide_Text_IO.Put_Line (Word);
   Ada.Text_IO.Put_Line (Integer'Image (Bytes'Length) & " " & Wide_Wide_Character'Image (Word (2)) & " " & Wide_Wide_Character'Image (Word (1)));
end Main;
