Skip to content

Instantly share code, notes, and snippets.

pragma(inline)
size_t utf8Length(char[] src) pure nothrow @trusted
{
size_t len = 0;
foreach (ref b; src) {
if ((b & 0xC0) != 0x80) len++;
}
return len;
}
REPORT ZWTF.
CLASS _ DEFINITION FINAL.
PUBLIC SECTION.
TYPES:
BEGIN OF t_ret,
_ TYPE REF TO string,
END OF t_ret.
CONSTANTS:
@maxfreck
maxfreck / WTFV2.ABAP
Created January 15, 2021 07:04
Upgraded WTF.ABAP
REPORT ZWTF.
CLASS _ DEFINITION FINAL.
PUBLIC SECTION.
TYPES:
BEGIN OF ___,
__ TYPE char1,
_ TYPE REF TO string,
END OF ___,
____ TYPE STANDARD TABLE OF ___ WITH KEY __,