title: mkChar does not escape percent sign
body: <p>I have the following code :</p>
  
  <pre><code>#include &lt;Rinternals.h&gt;
  #include &lt;cmath&gt;
  
  extern "C" {
  SEXP myChar(int x) {
    /*PrintValue(nam);*/
    SEXP colnames, result;
    PROTECT(colnames = Rf_allocVector(STRSXP,2));
    char buffer[20];
    int n = sprintf(buffer,"%4.2f%%",2.5);
    SET_STRING_ELT(colnames,0,mkChar(buffer));
    n = sprintf(buffer,"%4.2f%c",5.0,0x25);
    SET_STRING_ELT(colnames,1,mkChar(buffer));
  
    PROTECT(result = Rf_allocVector(VECSXP, 2));
    SEXP scol1 = PROTECT(allocVector(REALSXP,10));
    SEXP scol2 = PROTECT(allocVector(REALSXP,10));
  
    for (size_t k=0;k&lt;10;++k){
        REAL(scol1)[k] = std::pow(k,0.5);
        REAL(scol2)[k] = std::pow(k,0.7);
    }
    SET_VECTOR_ELT(result,0,scol1);
    SET_VECTOR_ELT(result,1,scol2);
  
    setAttrib(result, R_NamesSymbol, colnames);
    UNPROTECT(4);
    return(result);
  }
  }
  </code></pre>
  
  <p>I compile like this :</p>
  
  <pre><code>R CMD SHLIB myChar.cpp
  </code></pre>
  
  <p>And run the following in my R session :</p>
  
  <pre><code>&gt; dyn.load("myChar.so")
  &gt; out&lt;-as.data.frame(.Call("myChar"))
  &gt; out
         X2.50.     X5.00.
  1    0.000000   0.000000
  2    1.000000   1.000000
  3    1.414214   1.624505
  4    1.732051   2.157669
  5    2.000000   2.639016
  6    2.236068   3.085169
  7    2.449490   3.505144
  8    2.645751   3.904529
  9    2.828427   4.287094
  10   3.000000   4.655537
  </code></pre>
  
  <p>My question is why the column names doesn't show the percent sign? I use '%%' to escape the percent sign but in the column names it is converted to a period, i.e. instead of "X2.50%" I get "X2.50.". Is that a feature of mkChar? Is there any other way to convert char array to SEXP? </p>