Day 26/100 100 Days of Code

Chris DourisChris Douris
1 min read

I fixed an issue where it was impossible to lowercase any Greek characters. After experimenting with C++'s library, I decided to install the boost locale library to try it.

Lo' and behold! It worked! This means that both Greek and English languages are supported. Windows support might have problems as I might have to use wide strings instead. Fixing the problem required a few lines of code:

#include <boost/locale.hpp>
#include <boost/algorithm/string/case_conv.hpp>

boost::locale::generator gen;
std::locale::global(gen("el_GR.UTF-8"));
std::string keywordLowercase = boost::locale::to_lower(keyword);

I am not a fan of adding a new dependency for such a small task. But I was unable to find a good solution.

0
Subscribe to my newsletter

Read articles from Chris Douris directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Chris Douris
Chris Douris

AKA Chris, is a software developer from Athens, Greece. He started programming with basic when he was very young. He lost interest in programming during school years but after an unsuccessful career in audio, he decided focus on what he really loves which is technology. He loves working with older languages like C and wants to start programming electronics and microcontrollers because he wants to get into embedded systems programming.