It never happened and it happened again. Clean core requires a new class for code page and the old class is not allowed.
CL_ABAP_CODEPAGE
was a class SAP introduced long time ago and it was efficiently handling string <-> binary conversion for UTF-8 documents such as XML or JSON or whatever else.
We can see that is still present in a new ABAP documentation snippets.
However it turned out to be one more example when "Clean Core" concept simply prevented us from using this class:
The use of Class CL_ABAP_CODEPAGE is not permitted
So what should we use instead? Well there is another nice class which we can use: CL_ABAP_CONV_CODEPAGE
Introducing one class in a new environment which is not present in the old environment prevents us from reusing the code. Polyfill approach allows us to use one class which will work in any system.
Rountrip example from the unit test
data(test) = |This is a sample string|.
" String to xstring ( to codepage )
data(lv_binary) = zcl_abap_codepage=>to( test ).
" Xstring to string ( from codepage )
assert( zcl_abap_codepage=>from( lv_binary ) )->eq( test ).