X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/2e9ba080dd30434f3e8f88e63029280889586a32..16b0fea8ae1a581d568dbee2efa2932aa4e6fcce:/lib/charset.c diff --git a/lib/charset.c b/lib/charset.c index fdc6d61..b8af6e6 100644 --- a/lib/charset.c +++ b/lib/charset.c @@ -1,6 +1,6 @@ /* * This file is part of DisOrder. - * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell + * Copyright (C) 2004, 2005, 2007, 2008, 2013 Richard Kettlewell * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,9 +19,13 @@ #include "common.h" -#include +#if HAVE_ICONV_H +# include +#endif #include -#include +#if HAVE_LANGINFO_H +# include +#endif #include "mem.h" #include "log.h" @@ -30,6 +34,17 @@ #include "vector.h" #include "unicode.h" +#if _WIN32 +// TODO WIN32 we assume UTF-8 here, which is *definitely wrong* +char *mb2utf8(const char *mb) { + return xstrdup(mb); +} + +char *utf82mb(const char *utf8) { + return xstrdup(utf8); +} +#else + /** @brief Low-level converstion routine * @param from Source encoding * @param to Destination encoding @@ -113,6 +128,8 @@ char *any2any(const char *from, else return xstrdup(any); } +#endif + /** @brief Truncate a string for display purposes * @param s Pointer to UTF-8 string * @param max Maximum number of columns