When converting string literals to bytes literals, UP012 does not handle escape sequences that are only recognized in string literals. It should convert them to literal characters or to recognized escape sequences.
$ ruff --version
ruff 0.5.6
$ cat up012.py
print("\N{DIGIT ONE}".encode())
print("\u0031".encode())
print("\U00000031".encode())
$ python up012.py
b'1'
b'1'
b'1'
$ ruff check --isolated --select UP012 up012.py --fix
Found 3 errors (3 fixed, 0 remaining).
$ python up012.py
b'\\N{DIGIT ONE}'
b'\\u0031'
b'\\U00000031'