Thursday, November 4, 2010

How to convert UTF-8 to uppercase in C++ or C

#include <iostream>
#include <glib.h>
#include <string.h>

int main() {
   char * a="Télécommande";
   a = (char *) g_utf8_strup((const gchar*) a, strlen(a));

   std::cout << a << std::endl;

compile with :
g++ `pkg-config --cflags --libs gib-2.0` s.cpp

Output of the above program:

If the library is not present install libglib2.0-dev

No comments:

Post a Comment