好像跟 utf-8 没什么关系吧?
可以用这个 vfp 版的 printf,N年前好事者收集的,好在还能访问:https://
程序代码:
? printf('%c%c', 186,234)
PROCEDURE printf (lcSource, p0, p1, p2, p3, p4, p5, p6, p7,;
p8,p9,p10,p11,p12,p13,p14,p15)
* VFP Help: A maximum [color=#0000FF]of 27 parameters can be passed[/color]
* [color=#0000FF]from a calling program[/color]
LOCAL lnIndex, lcDecl, lvValue, lcType, lcDecl,;
lnResult, lcTarget
lcDecl = ""
FOR lnIndex=0 TO 15
IF lnIndex <= PARAMETERS()-2
lvValue = EVAL("p" + LTRIM(STR(lnIndex)))
lcType = TYPE("lvValue")
DO CASE
CASE lcType = "C"
lcDecl = lcDecl + ", STRING"
CASE lcType = "N"
lcDecl = lcDecl + ", INTEGER"
ENDCASE
ELSE
lcDecl = lcDecl + ", INTEGER"
ENDIF
ENDFOR
* every time this function has to be redeclared
* according to the parameters passed to it
lcDecl = "DECLARE INTEGER wnsprintf IN Shlwapi " +;
"STRING @lpOut, INTEGER cchLimitIn, STRING pszFmt" +;
lcDecl
&lcDecl
lcTarget = Space(4096)
lnResult = wnsprintf (@lcTarget, Len(lcTarget), lcSource,;
p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15)
RETURN Left(lcTarget, lnResult)