# Probable bug in Export(String) and “String” format

Bug introduced in 6.0 and persisting through 11.0.0 or later

ExportString[FullForm@f["String"], "String"]
ExportString[FullForm@f["string"], "String"]
(*==>*)
"f[\"\"]"
"f[\"string\"]"


I would expect

"f[\"String\"]"
"f[\"string\"]"


Obviously the string "String" receives some weird special treatment, but only if written verbatim with initial uppercase letter.

Confirmation?

• Yes, it is somehow getting replaced: TracePrint[ExportString["String", "String"], _ReplaceAll]. I have filed a bug report. – ilian Oct 4 '16 at 21:24
• @ilian Nice find. How did you know ExportString was implemented (partially?) in WL? Guess? Is all of the Import/Export stuff Wolfram Language code? – masterxilo Oct 4 '16 at 21:26
• same confirmed w/10.1 ( and same for regular Export to a file ) – george2079 Oct 4 '16 at 21:47
• Yes, a lot of the import/export code is implemented in top-level, though some of the functionality may call into the kernel or MathLink or LibraryLink libraries. – ilian Oct 4 '16 at 23:10
• I confirm the bug with versions 8.0.4 and 11.0.0. In version 5.2 the bug isn't present. – Alexey Popkov Oct 5 '16 at 0:55