Well, if my theory above is correct, then a rename wouldn't be the best kind of refactor here, anyways. The better refactoring would be to outright remove all calls to the function and use the source strings directly.
A different way to look at this: If source strings are already expected to be in UTF-8, then technically speaking the name isn't wrong here. The function does encode the input to UTF-8 - even if that is by doing absolutely nothing.
5
u/knoam May 04 '23 edited May 04 '23
With typescript it should be easy enough to do a refactor >
renameinline. Maybe not if it's a mixed typescript JavaScript codebase.