Get the previous and next values of a string in lexicographic order
Computing the previous and next lexicographic string is the same as subtracting and adding 1 to a number, only your number is encoded in some higher base corresponding to your alphabet. I presume you already know how to add and subtract 1, but if not, there are many online resources explaining that.

You mention UTF-8, which is not quite an ordered alphabet. Yet your SQL interpreter has some specific rules for ordering strings, and is should include an ordering of the actual alphabet (UTF-8 or smaller).