A Design for a Large Project Containing Unicode String

A Design for a Large Project Containing Unicode String

It has been stated before that hard-coded, literal strings are to be avoided. I disagree. There is an easy, convenient way to handle hard-coded, literal strings: use a macro directly in the code. Take a look:

    const char *msg1 = _LIT( _T("hello"), HELLO );

The _LIT macro is designed to simply return the first argument when DEBUG is defined. For release, you’d need to write a _LIT macro parser for the code to parse the _LIT macros, and create an enumerated “.h” table, and a “.dat” flat-file of literals. The flat-file can be read into an array during initialization, and all of the strings can be accessed by their index (i.e. HELLO=0). The released version of the _LIT macro might be defined as:

#define _LIT(a,b) LitArray[ b ]

You can add strings directly into your code, and not have to worry about localization. At release, the generated “.dat” file can then be translated?without changing the order of the strings.

The challenging part is making certain the strings are read in as UTF8, and that means saving the file as UTF8.

This configuration can go as far as naming the data file, based on configuration (e.g. “english.dat”, or “japanese.dat”). And applications can support multiple languages at the flip of a switch.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of