convert to 4-byte UTF-8 and 32-bit Rune
http://codereview.appspot.com/116075
This commit is contained in:
parent
4dbf255619
commit
0cadb4301d
14 changed files with 86 additions and 44 deletions
|
|
@ -605,12 +605,13 @@ __flagfmt(Fmt *f)
|
|||
int
|
||||
__badfmt(Fmt *f)
|
||||
{
|
||||
char x[3];
|
||||
char x[2+UTFmax];
|
||||
int n;
|
||||
|
||||
x[0] = '%';
|
||||
x[1] = f->r;
|
||||
x[2] = '%';
|
||||
f->prec = 3;
|
||||
__fmtcpy(f, (const void*)x, 3, 3);
|
||||
n = 1 + runetochar(x+1, &f->r);
|
||||
x[n++] = '%';
|
||||
f->prec = n;
|
||||
__fmtcpy(f, (const void*)x, n, n);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue