We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
LEVELS()
1 parent 23f0f30 commit 8ef43afCopy full SHA for 8ef43af
src/internal/encoding.c
@@ -189,9 +189,10 @@ bool str_needs_encoding(r_obj* x) {
189
return (!str_is_ascii_or_utf8(x)) && (x != NA_STRING);
190
}
191
192
+#if (R_VERSION < R_Version(4, 5, 0))
193
+
194
#define MASK_ASCII 8
195
#define MASK_UTF8 64
-
196
// The first 128 values are ASCII, and are the same regardless of the encoding.
197
// Otherwise we enforce UTF-8.
198
static inline
@@ -200,5 +201,11 @@ bool str_is_ascii_or_utf8(r_obj* x) {
200
201
return (levels & MASK_ASCII) || (levels & MASK_UTF8);
202
203
-#undef MASK_ASCII
204
-#undef MASK_UTF8
+#else
205
206
+static inline
207
+bool str_is_ascii_or_utf8(r_obj* x) {
208
+ return Rf_charIsUTF8(x);
209
+}
210
211
+#endif
0 commit comments