Limitation on Unicode Character Encodings for Reading | Teradata R Package - 17.00 - Limitation on Unicode Character Encodings for Reading - Teradata R Package

Teradata® R Package User Guide

prodname
Teradata R Package
vrm_release
17.00
created_date
November 2020
category
User Guide
featnum
B700-4005-090K
This limitation is only applicable when connecting to Vantage with Teradata ODBC Driver.

ODBC CharacterSet encodings UTF8 and UTF16 are not supported when reading data from a table containing Unicode characters.

To work around this limitation, use encoding = 'latin1' and CharcterSet = "ASCII" in the td_create_context function.

For example:
con <- td_create_context(dsn = "TeradataDSN", encoding = "latin1", CharcterSet = "ASCII")

dplyr::tbl(con, "TABLE_WITH_UNICODE_CHARS")

There is no limitation on writing data from an R data frame containing Unicode characters.

Create the connection with appropriate CharacterSet encodings.

For example:
con <- td_create_context("TeradataDSN1", CharacterSet = "UTF8")

# Sample R data frame containing unicode characters
mydf <- data.frame(id = c(101:103), str_utf = c("Rædwald", "Æthelhere", "Ecgric"), str_ascii = c("Abc", "XY", "DE1"))

dplyr::copy_to(con, df = mydf, name = "mydf_table")