我四处寻找答案,但没有找到正确的答案。我需要在 R 中将一个字符串转换成特定的编码格式,但无法实现:
string <- "überhaupt"
我需要的是:"überhaupt"
到目前为止,我使用了以下函数:
textutils::HTMLencode(string) gives: "überhaupt"
utf8::utf8_print(string, utf8 = F) gives: "\u00fcberhaupt"
iconv(string, from = "windows-1252", "utf-8") gives: "überhaupt"
看起来我需要使用十六进制数字字符引用https://en.wikipedia.org/wiki/%C3%9C,但我不知道如何进行转换。
感谢您的帮助。