convert the message to native encoding from UTF-8 before decoding it

on Windows, switch(input$foo, foo1 = val1) does not work even if input$foo ==
foo1 but Encoding(input$foo) is UTF-8 while foo1 is unknown (native encoding);
to prevent such problems, let's always use native encoding inside the shiny
process, and only do the UTF-8 conversion at I/O time

special thanks to @desar for the thorough tests
let's read ui.R, server.R, README.md, and DESCRIPTION also with UTF-8

the reason for this is that htmltools::htmlEscape() uses gsub(..., x, fixed =
TRUE), which does not work on Windows if x is encoded in UTF-8; fixed = TRUE
only works with the native encoding
json2.js modified and uglified from https://github.com/yihui/JSON-js via http://lisperator.net/uglifyjs/

I'm using the date of json2 as its version number, since it does not really have a version number

This should close rstudio/shiny-server#79
factor out .Platform$OS.type == 'windows' as isWindows()
fall back to native encoding on Windows if UTF-8 does not work
tweak the warning message

and simply stop() in case the user has set option(encoding = 'UTF-8')
Merge pull request #537 from yihui/bugfix/native-encoding

Use native encoding internally
bump version
an edge case selectInput(choices = NULL)

firstChoice() may fail with an error "subscript out of bounds"
Switch from refclasses to R6
Update tests for R6