Skip to content

How to use DSL to delete non-UTF-8 hex characters from a string? #985

Answered by pjfarleyiii
pjfarleyiii asked this question in Q&A
Discussion options

You must be logged in to vote

I was able to code a while loop to solve the issue, pasted below for future readers.

sup1 = "\xb9"; sup2 = "\xb2"; sup3 = "\xb3";
curln = strlen($Name); prvln = 0;
while (curln > prvln) {
    prvln = curln;
    $Name = ssub($Name, sup1, "");
    $Name = ssub($Name, sup2, "");
    $Name = ssub($Name, sup3, "");
    curln = strlen($Name);
}

Replies: 4 comments 12 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@aborruso
Comment options

@pjfarleyiii
Comment options

Comment options

You must be logged in to vote
9 replies
@johnkerl
Comment options

@pjfarleyiii
Comment options

@johnkerl
Comment options

@pjfarleyiii
Comment options

@johnkerl
Comment options

Answer selected by pjfarleyiii
Comment options

You must be logged in to vote
1 reply
@johnkerl
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants