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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,40843b637af826a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.181.13.205 with SMTP id fa13mr6204004wid.3.1354092770791; Wed, 28 Nov 2012 00:52:50 -0800 (PST) Path: ha8ni61809wib.1!nntp.google.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.134.4.91.MISMATCH!news2.euro.net!feeds.phibee-telecom.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: IBM 437 encoded String to UTF-16 Wide_String Date: Wed, 28 Nov 2012 09:52:33 +0100 Organization: cbb software GmbH Message-ID: References: <11112110-03b1-4977-ba80-00204926ea23@googlegroups.com> <68663891-14ad-4780-a00d-1cc48ed75323@googlegroups.com> <027679a1-dc5e-4888-9dd1-2a4ccf32e66c@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-11-28T09:52:33+01:00 List-Id: On Wed, 28 Nov 2012 00:34:53 -0800 (PST), briot.emmanuel@gmail.com wrote: > I think the most convenient here would be to create a small binding to the > iconv library. I believe it exists on most systems, although with slightly > different interfaces. And it supports a huge number of encodings. No. IMO the most convenient way would be to fix the language in order to have Wide_Wide_String'Class of which String, Wide_String, Wide_Wide_String, UTF8_String etc were members. Encoding is nothing but an instance of Wide_Wide_String'Class implementing the interface of an array of code units. In the case of IBM 437 it is something like: type IBM_437_String is new Wide_Wide_String -- Logical view, string of code points and array (Positive range <>) of Byte; -- Presentation view Conversions if ever needed, would be type/view conversions. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de