diff options
Diffstat (limited to 'src/bin/psql/mbprint.c')
-rw-r--r-- | src/bin/psql/mbprint.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/bin/psql/mbprint.c b/src/bin/psql/mbprint.c index 692f60bf775..437d7271c0d 100644 --- a/src/bin/psql/mbprint.c +++ b/src/bin/psql/mbprint.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/mbprint.c,v 1.6 2003/03/18 22:15:44 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/mbprint.c,v 1.7 2003/07/27 03:32:26 momjian Exp $ */ #include "postgres_fe.h" @@ -11,6 +11,10 @@ #include "mb/pg_wchar.h" +#ifdef WIN32 +#include <windows.h> +#endif + /* * This is an implementation of wcwidth() and wcswidth() as defined in * "The Single UNIX Specification, Version 2, The Open Group, 1997" @@ -330,6 +334,14 @@ mbvalidate(unsigned char *pwcs, int encoding) return mb_utf_validate(pwcs); else { +#ifdef WIN32 + /* + * translate characters to DOS console encoding, e.g. needed + * for German umlauts + */ + if (GetVariableBool(pset.vars, "WIN32_CONSOLE")) + CharToOem(pwcs, pwcs); +#endif /* * other encodings needing validation should add their own * routines here |