From 56135c623a865c501ab31cc940c0e22ece2673f4 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Fri, 3 Jun 2011 11:31:24 +0200 Subject: Imported Upstream version 2011.06.02 --- src/pkg/fmt/format.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/pkg/fmt/format.go') diff --git a/src/pkg/fmt/format.go b/src/pkg/fmt/format.go index f9d2b4fca..5dcfb9677 100644 --- a/src/pkg/fmt/format.go +++ b/src/pkg/fmt/format.go @@ -296,6 +296,13 @@ func (f *fmt) fmt_q(s string) { f.padString(quoted) } +// fmt_qc formats the integer as a single-quoted, escaped Go character constant. +// If the character is not valid Unicode, it will print '\ufffd'. +func (f *fmt) fmt_qc(c int64) { + quoted := strconv.QuoteRune(int(c)) + f.padString(quoted) +} + // floating-point func doPrec(f *fmt, def int) int { -- cgit v1.2.3