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 {
354354 return std::wstring ( s, s + strlen (s) );
355355 }
356356
357-
358357 inline const char * get_cstring () const {
359358 return buffer_ready ? buffer.c_str () : CHAR (data) ;
360359 }
361360
362- inline const char * get_encoding () const {
361+ inline const std::string get_encoding () const {
363362 switch (enc) {
364363 case CE_BYTES:
365364 return " bytes" ;
@@ -373,14 +372,12 @@ namespace Rcpp {
373372 }
374373
375374 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);
381378 }
382379
383- inline void set_encoding (const char * encoding) {
380+ inline void set_encoding (const std::string & encoding) {
384381 if ( encoding == " bytes" ) {
385382 enc = CE_BYTES;
386383 } else if ( encoding == " latin1" ) {
You can’t perform that action at this time.
0 commit comments