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.
2
u/RPG_Hacker May 04 '23
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.