These rules apply no matter which language you are using. In other words, they are not specific to Ada, and you should already know them, but they bear repeating.

Internally in your application, you should not have to care about encodings. At all.

In your application, you should have The String Type that represents text of any flavour, be it English, Navaho or Chinese. It’s really simple. What encoding does The String Type use? Who cares. Well, I care, of course, but it doesn’t matter for my code.

Ideally, The String Type should be an abstraction that supports various operations you might expect to perform on written text, such as

concatenation (smushing two strings together)

search (and replace),

converting it to uppercase (trickier than you think!),

truncating it after x characters, and

splitting it up into lines.

I say “ideally” because they’re not strictly required. Only if you actually want to use them do you need The String Type to support them.

A word of caution: in many languages, The String Type is not actually the type called String . Examples where this confusion occurs include Python 2, Haskell and Ada. In these languages, the type called String is not The String Type.

So when do encodings matter? When you want text to exit your application. Maybe you write it to a file, or you send it over the internet, or you print it to the user. This is when encodings matter, because the receiver will expect a certain pattern of bits, so you need to put out the right pattern of bits.

To put text data out of your application, you take a value of The String Type, you specify an encoding (which is essentially something that tells you how to convert a text value to bits) and you write out the result of running the text value through the encoding.

To get text data inside your application, you do the opposite: take some data source, take an encoding, and decode the data into a value of The String Type.

This sound familiar? This is essentially how you deal with every data type ever. A Python dict is never “encoded” as long as it stays inside the Python application. It’s just a dict . Only when you want to put it out on the internet do you encode it to e.g. JSON, which is a bit pattern representing a dict , but it is not a dict itself.