summaryrefslogtreecommitdiff
path: root/src/lib/fmt/print.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/fmt/print.go')
-rw-r--r--src/lib/fmt/print.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/fmt/print.go b/src/lib/fmt/print.go
index 67d56e1c1..0e7569731 100644
--- a/src/lib/fmt/print.go
+++ b/src/lib/fmt/print.go
@@ -14,6 +14,7 @@ import (
"io";
"reflect";
"os";
+ "utf8";
)
// Representation of printer state passed to custom formatters.
@@ -438,7 +439,7 @@ func (p *pp) doprintf(format string, v reflect.StructValue) {
end := len(format) - 1;
fieldnum := 0; // we process one field per non-trivial format
for i := 0; i <= end; {
- c, w := sys.stringtorune(format, i);
+ c, w := utf8.DecodeRuneInString(format, i);
if c != '%' || i == end {
p.add(c);
i += w;
@@ -469,7 +470,7 @@ func (p *pp) doprintf(format string, v reflect.StructValue) {
if i < end && format[i] == '.' {
p.fmt.prec, p.fmt.prec_present, i = parsenum(format, i+1, end);
}
- c, w = sys.stringtorune(format, i);
+ c, w = utf8.DecodeRuneInString(format, i);
i += w;
// percent is special - absorbs no operand
if c == '%' {