bash $PS1 containing an emoj
You can always wrap in additional command substitutions to do this, for eg:

$ printf "%s  &lt;-- some space after it" "$(echo -en " RC=${exit_code} "'\xf0\x9f\x98\xb1\x0a')"
 RC=   &lt;-- some space after it


I'm not sure why you have that NUL character (\x00) trailing but with that I was getting this error message:

$ printf "%s  &lt;-- some space after it" "$(echo -en " RC=${exit_code} "'\xf0\x9f\x98\xb1\x0a\x00')"
-bash: warning: command substitution: ignored null byte in input
 RC=   &lt;-- some space after it


So I simply removed it.

Here I've wrapped your original echo command in a command substitution $(..command..) and then passed its output to printf to produce any additional formatting.

General structure:

$ printf "%s ...." "$(..command to produce output..)"


Additional Example

You could also use printf exclusively. I'm not entirely sure what your goal is here but you could do something like this:

$ printf "RC=${exit_code} \xf0\x9f\x98\xb1  &lt;-- some space after it\n\n"
RC=   &lt;-- some space after it


The UTF-8 code \x0a is a linefeed character, the above example removed it + the NUL, \x00 and added 2 newlines to the end instead, \n\n.