我正试图通过RPostgreSQL
包从Postgres数据库中获取一些数据。结果data.frame中的字符列具有unknown
编码:
Encoding(raw_orders$city)
[1] "unknown" "unknown" "unknown" "unknown" "unknown" "unknown" "unknown" "unknown" "unknown" "unknown" "unknown" "unknown"
尽管我将每个可以想象的编码标志设置为UTF-8:
> dbGetQuery(connection_postgres, "SHOW CLIENT_ENCODING")
client_encoding
1 UTF8
> dbGetQuery(connection_postgres, "SHOW SERVER_ENCODING")
server_encoding
1 UTF8
> Sys.getlocale()
[1] "en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8"
如何强制UTF-8适用于所有字符列,而无需通过Encoding()
手动设置它?