strTxt = 'ной'
x = 'ной'.encode(encoding='ascii')
UnicodeEncodeError: 'ascii' codec cant encode characters in position 0-2: ordinal not in range(128)
x = b'ной'
SyntaxError: bytes can only contain ASCII literal characters.
for char in 'ной':
x=b''
r = (ord(char) & 0xff)
x += r.to_bytes(1,byteorder='big')
print(x)
b'9'
b'\xed\xee\xe9'
'ной'.encode('cp1251') == b'\xed\xee\xe9'