1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- ADA.STRINGS.UTF_ENCODING.CONVERSIONS --
9 -- This specification is derived from the Ada Reference Manual for use with --
10 -- GNAT. In accordance with the copyright of that document, you can freely --
11 -- copy and modify this specification, provided that if you redistribute a --
12 -- modified version, any changes that you have made are clearly indicated. --
14 ------------------------------------------------------------------------------
16 -- This is an Ada 2012 package defined in AI05-0137-1. It provides conversions
17 -- from one UTF encoding method to another. Note: this package is consistent
18 -- with Ada 95, and may be used in Ada 95 or Ada 2005 mode.
20 package Ada
.Strings
.UTF_Encoding
.Conversions
is
21 pragma Pure
(Conversions
);
23 -- In the following conversion routines, a BOM in the input that matches
24 -- the encoding scheme is ignored, an incorrect BOM causes Encoding_Error
25 -- to be raised. A BOM is present in the output if the Output_BOM parameter
30 Input_Scheme
: Encoding_Scheme
;
31 Output_Scheme
: Encoding_Scheme
;
32 Output_BOM
: Boolean := False) return UTF_String
;
33 -- Convert from input encoded in UTF-8, UTF-16LE, or UTF-16BE as specified
34 -- by the Input_Scheme argument, and generate an output encoded in one of
35 -- these three schemes as specified by the Output_Scheme argument.
39 Input_Scheme
: Encoding_Scheme
;
40 Output_BOM
: Boolean := False) return UTF_16_Wide_String
;
41 -- Convert from input encoded in UTF-8, UTF-16LE, or UTF-16BE as specified
42 -- by the Input_Scheme argument, and generate an output encoded in UTF-16.
46 Output_BOM
: Boolean := False) return UTF_16_Wide_String
;
47 -- Convert from UTF-8 to UTF-16
50 (Item
: UTF_16_Wide_String
;
51 Output_Scheme
: Encoding_Scheme
;
52 Output_BOM
: Boolean := False) return UTF_String
;
53 -- Convert from UTF-16 to UTF-8, UTF-16LE, or UTF-16BE as specified by
54 -- the Output_Scheme argument.
57 (Item
: UTF_16_Wide_String
;
58 Output_BOM
: Boolean := False) return UTF_8_String
;
59 -- Convert from UTF-16 to UTF-8
61 end Ada
.Strings
.UTF_Encoding
.Conversions
;