<commit_before>diff --git a/bindings/pyroot_experimental/cppyy/CPyCppyy/src/Converters.cxx b/bindings/pyroot_experimental/cppyy/CPyCppyy/src/Converters.cxx
index a470a41..56d486d 100644
--- a/bindings/pyroot_experimental/cppyy/CPyCppyy/src/Converters.cxx
+++ b/bindings/pyroot_experimental/cppyy/CPyCppyy/src/Converters.cxx
@@ -1026,6 +1026,7 @@ bool CPyCppyy::name##Converter::ToMemory(PyObject* value, void* address)     \
     return InstancePtrConverter::ToMemory(value, address);                   \
 }
 
+CPPYY_IMPL_STRING_AS_PRIMITIVE_CONVERTER(TString, TString, Data, Length)
 CPPYY_IMPL_STRING_AS_PRIMITIVE_CONVERTER(STLString, std::string, c_str, size)
 CPPYY_IMPL_STRING_AS_PRIMITIVE_CONVERTER(STLStringViewBase, std::string_view, data, size)
 bool CPyCppyy::STLStringViewConverter::SetArg(
@@ -2068,6 +2069,9 @@ public:
         gf["const ULong64_t&"] =            gf["const unsigned long long&"];
 
     // factories for special cases
+        gf["TString"] =                     (cf_t)+[](long) { return new TStringConverter{}; };
+        gf["TString&"] =                    (cf_t)+[](long) { return new TStringConverter{}; };
+        gf["const TString&"] =              (cf_t)+[](long) { return new TStringConverter{}; };
         gf["const char*"] =                 (cf_t)+[](long) { return new CStringConverter{}; };
         gf["const char[]"] =                (cf_t)+[](long) { return new CStringConverter{}; };
         gf["char*"] =                       (cf_t)+[](long) { return new NonConstCStringConverter{}; };
diff --git a/bindings/pyroot_experimental/cppyy/CPyCppyy/src/DeclareConverters.h b/bindings/pyroot_experimental/cppyy/CPyCppyy/src/DeclareConverters.h
index 172d19a..880ae04 100644
--- a/bindings/pyroot_experimental/cppyy/CPyCppyy/src/DeclareConverters.h
+++ b/bindings/pyroot_experimental/cppyy/CPyCppyy/src/DeclareConverters.h
@@ -9,6 +9,9 @@
 #include <string>
 #include "ROOT/RStringView.hxx"
 
+// ROOT
+#include "TString.h"
+
 
 namespace CPyCppyy {
 
@@ -264,6 +267,7 @@ protected:                                                                   \
     strtype fBuffer;                                                         \
 }
 
+CPPYY_DECLARE_STRING_CONVERTER(TString, TString);
 CPPYY_DECLARE_STRING_CONVERTER(STLString, std::string);
 CPPYY_DECLARE_STRING_CONVERTER(STLStringViewBase, std::string_view);
 class STLStringViewConverter : public STLStringViewBaseConverter {<commit_msg>[Exp PyROOT] Update TString converter patch<commit_after>diff --git a/bindings/pyroot_experimental/cppyy/CPyCppyy/src/Converters.cxx b/bindings/pyroot_experimental/cppyy/CPyCppyy/src/Converters.cxx
index 9b6807d..9ad6adc 100644
--- a/bindings/pyroot_experimental/cppyy/CPyCppyy/src/Converters.cxx
+++ b/bindings/pyroot_experimental/cppyy/CPyCppyy/src/Converters.cxx
@@ -1044,6 +1044,7 @@ bool CPyCppyy::name##Converter::ToMemory(PyObject* value, void* address)     \
     return InstancePtrConverter::ToMemory(value, address);                   \
 }
 
+CPPYY_IMPL_STRING_AS_PRIMITIVE_CONVERTER(TString, TString, Data, Length)
 CPPYY_IMPL_STRING_AS_PRIMITIVE_CONVERTER(STLString, std::string, c_str, size)
 CPPYY_IMPL_STRING_AS_PRIMITIVE_CONVERTER(STLStringViewBase, std::string_view, data, size)
 bool CPyCppyy::STLStringViewConverter::SetArg(
@@ -2174,6 +2175,9 @@ public:
         gf["const ULong64_t&"] =            gf["const unsigned long long&"];
 
     // factories for special cases
+        gf["TString"] =                     (cf_t)+[](long) { return new TStringConverter{}; };
+        gf["TString&"] =                    (cf_t)+[](long) { return new TStringConverter{}; };
+        gf["const TString&"] =              (cf_t)+[](long) { return new TStringConverter{}; };
         gf["const char*"] =                 (cf_t)+[](long) { return new CStringConverter{}; };
         gf["const char[]"] =                (cf_t)+[](long) { return new CStringConverter{}; };
         gf["char*"] =                       (cf_t)+[](long) { return new NonConstCStringConverter{}; };
diff --git a/bindings/pyroot_experimental/cppyy/CPyCppyy/src/DeclareConverters.h b/bindings/pyroot_experimental/cppyy/CPyCppyy/src/DeclareConverters.h
index c395d3b..1045279 100644
--- a/bindings/pyroot_experimental/cppyy/CPyCppyy/src/DeclareConverters.h
+++ b/bindings/pyroot_experimental/cppyy/CPyCppyy/src/DeclareConverters.h
@@ -9,6 +9,9 @@
 #include <string>
 #include "ROOT/RStringView.hxx"
 
+// ROOT
+#include "TString.h"
+
 
 namespace CPyCppyy {
 
@@ -267,6 +270,7 @@ protected:                                                                   \
     strtype fBuffer;                                                         \
 }
 
+CPPYY_DECLARE_STRING_CONVERTER(TString, TString);
 CPPYY_DECLARE_STRING_CONVERTER(STLString, std::string);
 CPPYY_DECLARE_STRING_CONVERTER(STLStringViewBase, std::string_view);
 class STLStringViewConverter : public STLStringViewBaseConverter {
{'fraction_non_alphanumeric': 0.13499184339314846, 'fraction_numerical': 0.026508972267536703, 'mean_word_length': 3.073920265780731, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6960950', 'n_tokens_mistral': 1782, 'n_tokens_neox': 1653, 'n_words': 233}