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

Teradata® Package for R User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for R
Release Number
17.20
Published
March 2024
Language
English (United States)
Last Update
2024-04-09
dita:mapPath
efv1707506846369.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
nqx1518630623256
Product Category
Teradata Vantage
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")