Olav SørensenPushed v1.23 code986a9df6 years agoHistory
53 lines · 1.5 KB · C
RawDownload
#pragma once #include <stdbool.h> #ifdef _WIN32#include <wchar.h>#endif // unicode stuff for different platforms #ifdef _WIN32 // Windowstypedef wchar_t UNICHAR;#define UNICHAR_STRCPY(a, b) wcscpy(a, b)#define UNICHAR_STRNCPY(a, b, c) wcsncpy(a, b, c)#define UNICHAR_STRCMP(a, b) wcscmp(a, b)#define UNICHAR_STRNCMP(a, b, c) wcsncmp(a, b, c)#define UNICHAR_STRCAT(a, b) wcscat(a, b)#define UNICHAR_STRDUP(a) _wcsdup(a)#define UNICHAR_FOPEN(a, b) _wfopen(a, L ## b)#define UNICHAR_CHDIR(a) _wchdir(a)#define UNICHAR_GETCWD(a, b) _wgetcwd(a, b)#define UNICHAR_RENAME(a, b) _wrename(a, b)#define UNICHAR_REMOVE(a) _wremove(a)#define UNICHAR_STRLEN(a) wcslen(a)#else // other OSestypedef char UNICHAR;#define UNICHAR_STRCPY(a, b) strcpy(a, b)#define UNICHAR_STRNCPY(a, b, c) strncpy(a, b, c)#define UNICHAR_STRCMP(a, b) strcmp(a, b)#define UNICHAR_STRNCMP(a, b, c) strncmp(a, b, c)#define UNICHAR_STRCAT(a, b) strcat(a, b)#define UNICHAR_STRDUP(a) strdup(a)#define UNICHAR_FOPEN(a, b) fopen(a, b)#define UNICHAR_CHDIR(a) chdir(a)#define UNICHAR_GETCWD(a, b) getcwd(a, b)#define UNICHAR_RENAME(a, b) rename(a, b)#define UNICHAR_REMOVE(a) remove(a)#define UNICHAR_STRLEN(a) strlen(a)#endif char *cp437ToUtf8(char *src);char *utf8ToCp437(char *src, bool removeIllegalChars);#ifdef _WIN32UNICHAR *cp437ToUnichar(char *src);char *unicharToCp437(UNICHAR *src, bool removeIllegalChars);#else#define cp437ToUnichar(a) cp437ToUtf8(a)#define unicharToCp437(a, b) utf8ToCp437(a, b)#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t