title: Why do these identical Unicode strings have different serialized forms?
body: <p>When I compare a string literal with a non-ASCII character in R source code to the same string passed in through the command line, the two strings test as <code>identical</code> and have identical <code>charToRaw</code> representations, but <code>serialize</code> differently. What's going on? Aren't both strings in UTF-8?</p>
  <p>To reproduce this, try this shell script (I'm running Dash 0.5.10.2-7 and R 4.0.2 on Ubuntu 20.10):</p>
  <pre><code>echo 'x=&quot;α&quot;' &gt; program.R
  R --vanilla -q -e \
  'source(&quot;program.R&quot;)
  print(identical(x, &quot;α&quot;))
  print(identical(charToRaw(x), charToRaw(&quot;α&quot;)))
  print(identical(serialize(x, NULL), serialize(&quot;α&quot;, NULL)))'
  </code></pre>
  <p>which produces</p>
  <pre><code>&gt; source(&quot;program.R&quot;)
  &gt; print(identical(x, &quot;α&quot;))
  [1] TRUE
  &gt; print(identical(charToRaw(x), charToRaw(&quot;α&quot;)))
  [1] TRUE
  &gt; print(identical(serialize(x, NULL), serialize(&quot;α&quot;, NULL)))
  [1] FALSE
  </code></pre>