From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,695f23160a3223e X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: Unchecked conversion of arrays? Date: Sun, 16 May 2004 20:44:37 +0100 Message-ID: <2gpul4F5bmduU1@uni-berlin.de> References: <7_Soc.92431$dP1.290953@newsc.telia.net> X-Trace: news.uni-berlin.de WZQjqVUQKmjjJDCHfoZstQCK3xMCRDVChEdDWp4qK4ixeRW0Y= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Xref: controlnews3.google.com comp.lang.ada:614 Date: 2004-05-16T20:44:37+01:00 List-Id: "Bj�rn Persson" wrote in message news:7_Soc.92431$dP1.290953@newsc.telia.net... Let's say I have a Wide_String that I need to convert to an array of bytes. Each byte will of course contain half a Wide_Character, with the other half in the next byte. Will I have to copy one character at a time or is there a faster way to do this with representation clauses or something? I'm thinking Unchecked_Conversion won't be reliable, because if for example the byte array is packed and Wide_String is not, then (on a 32-bit machine) I'll get two bytes of garbage between every two bytes of character data. Have you considered using streams and Wide_String'Write? -- Nick Roberts