From 1c8147c21c077b953dce4dec6273f839e88e7121 Mon Sep 17 00:00:00 2001 From: ehouse Date: Sat, 29 Aug 2009 16:09:58 +0000 Subject: [PATCH] Tweak to support non-ascii utf-8 chars from dicts. Seems to display Catalan and Polish fine (on board.) --- xwords4/linux/linuxdict.c | 2 +- xwords4/linux/xptypes.h | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/xwords4/linux/linuxdict.c b/xwords4/linux/linuxdict.c index 48ad8f6da..d6acaf4a4 100644 --- a/xwords4/linux/linuxdict.c +++ b/xwords4/linux/linuxdict.c @@ -1,4 +1,4 @@ -/* -*-mode: C; fill-column: 78; c-basic-offset: 4;-*- */ +/* -*-mode: C; fill-column: 78; c-basic-offset: 4; compile-command: "make MEMDEBUG=TRUE"; -*- */ /* * Copyright 1997-2009 by Eric House (xwords@eehouse.org). All rights * reserved. diff --git a/xwords4/linux/xptypes.h b/xwords4/linux/xptypes.h index a527a6db4..19fa0b698 100644 --- a/xwords4/linux/xptypes.h +++ b/xwords4/linux/xptypes.h @@ -1,6 +1,7 @@ /* -*-mode: C; fill-column: 78; c-basic-offset: 4; -*- */ /* - * Copyright 1997 - 2000 by Eric House (xwords@eehouse.org). All rights reserved. + * Copyright 1997 - 2009 by Eric House (xwords@eehouse.org). All rights + * reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -38,7 +39,16 @@ typedef unsigned char XP_U8; typedef signed char XP_S8; + +#ifdef XWFEATURE_UNICODE +typedef gchar XP_UCHAR; +# define XP_L(s) s +# define XP_S XP_L("%s") +#else +/* This doesn't work. Turn on UNICODE for now... */ typedef char XP_UCHAR; +# define XP_L(s) ##s +#endif typedef unsigned short XP_U16; typedef signed short XP_S16; @@ -55,8 +65,7 @@ typedef guint32 XP_Time; typedef unsigned long XP_Time; #endif -#define XP_CR "\n" -#define XP_S "%s" +#define XP_CR XP_L("\n") #define XP_STATUSF XP_DEBUGF #define XP_LOGF XP_DEBUGF