colorize icon indicating copy to clipboard operation
colorize copied to clipboard

Compatibility with Windows

Open nxrighthere opened this issue 6 years ago • 3 comments

I built the console application using MinGW and noticed the Colorize screwing output text like when you encounter encoding problems. What can cause this?

nxrighthere avatar Mar 11 '19 13:03 nxrighthere

In Windows support for colors has to be explicitly enabled. I added a function to the demo which did the trick in a project where I used this, but haven't tried the code out on Windows yet! Let me know if the update works for you.

SanderMertens avatar Mar 11 '19 16:03 SanderMertens

No luck unfortunately, 'ID' becomes [0;36m'ID'[0;49m in the console window.

nxrighthere avatar Mar 11 '19 18:03 nxrighthere

Also, GCC on Ubuntu throws warnings during compilation:

colorize.c: In function ‘ut_strbuf_append_intern’:
colorize.c:258:17: warning: implicit declaration of function ‘strdup’ [-Wimplicit-function-declaration]
                 char *remainder = strdup(str + memLeftInElement);
                 ^
colorize.c:258:35: warning: initialization makes pointer from integer without a cast [enabled by default]
                 char *remainder = strdup(str + memLeftInElement);
                                   ^
colorize.c: In function ‘ut_strbuf_get’:
colorize.c:331:20: warning: assignment makes pointer from integer without a cast [enabled by default]
             result = strdup(b->buf);
                    ^

nxrighthere avatar Mar 11 '19 18:03 nxrighthere