Skip to content

darkbatcher/libcu8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

                    ,--.    ,--. ,--.                     ,---.  
                    |  |    `--' |  |-.   ,---. ,--.,--. |  o  | 
                    |  |    ,--. | .-. ' | .--' |  ||  | .'   '. 
                    |  '--. |  | | `-' | \ `--. '  ''  ' |  o  | 
                    `-----' `--'  `---'   `---'  `----'   `---'

     The libcu8 library is designed to fix the most important flaw of msvcrt 
     lib, that is, the poor support of unicode (and particularly utf-8). It is 
     well known that the original msvcrt misbehaves when it comes to unicode 
     characters (or wide characters, as they pretty much represent the same 
     thing) and particularly utf-8. 

     For this particular reason, most ms-windows purists will tell you never 
     to use microsoft's c-runtime. Instead, they will tell you to use the 
     native windows API. Obviously, we do not think so. We do not want 
     cross-platform compatibility of C standard library to be sacrified on the 
     altar of heavily platform-dependent APIs. Thus, we decided to write a 
     library to upgrade msvcrt and support utf-8.

What is libcu8, and how does it work ?

     Yet, Not another standalone C library

          libcu8 is a library designed as improovement of msvcrt rather than a 
          replacement of it. Indeed, libcu8 is not a standalone library, but 
          it extends functionnalities of msvcrt to be able to use utf-8. Thus, 
          you won't have to re-build any of your libraries to fit with libcu8, 
          and you won't have to change your compiler's parameters either.

     Safe And flexible

          What it basically does is just overwriting a few msvcrt functions 
          within the process memory, so that msvcrt appears to be modified to 
          any other component (eg. libraries, etc.) used by the process, what 
          wouldn't be possible with two standalone libraries. It also prevents 
          permanent modifications of msvcrt, that could be source of bugs with 
          programs not designed to use libcu8.

     Easy to use

          Finally, it is incredibly easy to use : You won't have to heavily 
          modify source code of any of your programs. A few lines are 
          sufficient to upgrade a whole program, and moreover, you won't have 
          to change your coding style. It is as simple as that : add a few 
          lines, re-build your program, and you're done !

Getting started

     It is really easy to get started with libcu8... You only have to do three 
     thing : 

        - Get the lib's binary, and link it with the program you using your 
          favourite build system (Yet, that was the harder part of the job). 

        - Add a few lines to tell the library to inject its functions. By the 
          way, doing so is extremely simple, just use libcu8_init(), as shown 
          below.

             if (libcu8_init(NULL) == -1) {
             /* handle the error */
             }

        - Last but not least, don't forget to be sure to use truetype fonts  
          instead of rasters ones if you use the command prompt.

     In fact, libcu8 can do a couple more things, but these are described in 
     DOC.

Building libcu8

     Libcu8 uses GNU autotools as build, but building libcu8 is quite 
     straigthforward, just do :

        ./configure
        make

     Few more targets are available, such as run-tests or install. Note that 
     libcu8 depends on libiconv, so you need to have it installed in order to 
     be able to build libcu8

About

A library to dynamically fix msvcrt to support utf8

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published