Colorizing Shell Script Logs with ANSI Escape Codes
Introduction
Shell scripts can be made more readable by adding color to they output. This is achieved by embedding ANSI escape codes direct into the output stream. These codes are interpreted by most modern terminals to change text attributes like color. Below is a comprehensive guide on how to implement colored logging in a Bash script.
Comple ...
Posted on Fri, 10 Jul 2026 17:06:15 +0000 by borris_uk
Character Encoding Conversion Techniques in C++
// Convert UTF-8 to GB2312
char* ConvertUTF8ToGB(const char* utfInput) {
int bufferSize = MultiByteToWideChar(CP_UTF8, 0, utfInput, -1, NULL, 0);
wchar_t* wideBuffer = new wchar_t[bufferSize+1];
memset(wideBuffer, 0, (bufferSize+1)*sizeof(wchar_t));
MultiByteToWideChar(CP_UTF8, 0, utfInput, -1, wideBuffer, bufferSize);
...
Posted on Mon, 22 Jun 2026 17:59:29 +0000 by Reformed