In English, everything worked fine and as expected. However when using a localized format string (Japanese), the parameter substitution failed:
string.Format("数字は、{0}", parm1);
(If you don't have the necessary language pack installed, here is a image representation of the text:
![](http://4.bp.blogspot.com/_VVshNYBIeBQ/SKSEVPjln3I/AAAAAAAAACA/beVpF4ervs8/s400/fmt.gif)
It turns out that the translated text was using different braces than 0x7B and 0x7D. In the translated text the left brace was 0xFF5B. Looks like a brace, but isn't for the purposes of string.Format. Further, in looking at the MS Mincho char set, I couldn't find that particular brace. Using the Alt+65371 trick for that character in notepad, I'd get a left bracket -- don't know what/where the brace comes from...
The simple fix was to change the 0xFF5B brace to the correct 0x7B, and then string.Format worked as expected.
No comments:
Post a Comment