From e2bea6019fd523d4b6061174b114c49f55fa981c Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sun, 24 Feb 2013 00:26:07 +0000 Subject: Use unicode quote characters in error messages etc; fixes #2507 We only use the unicode characters if the locale supports them. --- compiler/utils/Outputable.lhs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compiler/utils') diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs index 9e83634fab..f26f918068 100644 --- a/compiler/utils/Outputable.lhs +++ b/compiler/utils/Outputable.lhs @@ -72,6 +72,7 @@ module Outputable ( import {-# SOURCE #-} DynFlags( DynFlags, targetPlatform, pprUserLength, pprCols, + useUnicodeQuotes, unsafeGlobalDynFlags ) import {-# SOURCE #-} Module( Module, ModuleName, moduleName ) import {-# SOURCE #-} Name( Name, nameModule ) @@ -448,7 +449,11 @@ cparen b d = SDoc $ Pretty.cparen b . runSDoc d -- 'quotes' encloses something in single quotes... -- but it omits them if the thing begins or ends in a single quote -- so that we don't get `foo''. Instead we just have foo'. -quotes d = SDoc $ \sty -> +quotes d = + sdocWithDynFlags $ \dflags -> + if useUnicodeQuotes dflags + then char '‛' <> d <> char '’' + else SDoc $ \sty -> let pp_d = runSDoc d sty str = show pp_d in case (str, snocView str) of -- cgit v1.2.1