File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -354,12 +354,11 @@ namespace Rcpp {
354
354
return std::wstring ( s, s + strlen (s) );
355
355
}
356
356
357
-
358
357
inline const char * get_cstring () const {
359
358
return buffer_ready ? buffer.c_str () : CHAR (data) ;
360
359
}
361
360
362
- inline const char * get_encoding () const {
361
+ inline const std::string get_encoding () const {
363
362
switch (enc) {
364
363
case CE_BYTES:
365
364
return " bytes" ;
@@ -373,14 +372,12 @@ namespace Rcpp {
373
372
}
374
373
375
374
inline void set_encoding ( cetype_t encoding ) {
376
- if (enc != encoding) {
377
- enc = encoding;
378
- if (data != NULL )
379
- data = Rf_mkCharCE (Rf_translateCharUTF8 (data), enc);
380
- }
375
+ enc = encoding;
376
+ if (data != NULL )
377
+ data = Rf_mkCharCE (Rf_translateCharUTF8 (data), enc);
381
378
}
382
379
383
- inline void set_encoding (const char * encoding) {
380
+ inline void set_encoding (const std::string & encoding) {
384
381
if ( encoding == " bytes" ) {
385
382
enc = CE_BYTES;
386
383
} else if ( encoding == " latin1" ) {
You can’t perform that action at this time.
0 commit comments