Merge change 4792 into donut

* changes:
  when we reset a paint, it should return to the state it was in when it was first created. for java, this means setting its text-encoding to UTF16...