# NOT RUN {
# Let's create a string marked as UTF-8 (which is guaranteed by the
# Unicode escaping in the string):
utf8 <- "caf\uE9"
str_encoding(utf8)
as_bytes(utf8)
# It can then be converted to a native encoding, that is, the
# encoding specified in the current locale:
# }
# NOT RUN {
mut_latin1_locale()
latin1 <- as_native_string(utf8)
str_encoding(latin1)
as_bytes(latin1)
# }
Run the code above in your browser using DataLab