Abstract
Working with text will be one of the most regular tasks a C++ programmer will have to deal with. You are likely to need to read in user input, write out messages to the user, or write logging functionality for other programmers to more easily debug running programs. Unfortunately, working with text is not an easy or straightforward task. All too often, programmers rush into the job and make fundamental errors with their text handling which become major issues later into their projects. The worst of these is not properly accounting for localized versions of text strings. Working with English character sets is generally easy as all English characters and punctuation fit into the ASCII character set. This is convenient as every character needed to represent the English language can fit into a single 8-bit char variable. Things become problematic as soon as you are required to support foreign languages with your programs. Every character which you need to support will no longer fit into a single 8-bit value. C++ can handle non-English languages in a number of ways which will be covered in this chapter.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsAuthor information
Authors and Affiliations
Rights and permissions
Copyright information
© 2020 J. Burton Browning and Bruce Sutherland
About this chapter
Cite this chapter
Browning, J.B., Sutherland, B. (2020). Working with Text. In: C++20 Recipes. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5713-5_3
Download citation
DOI: https://doi.org/10.1007/978-1-4842-5713-5_3
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-5712-8
Online ISBN: 978-1-4842-5713-5
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books