How to convert toString ('hex') in Node back

http://nodejs.cn/api/buffer.h.

for example, there is a text saying "it"s a beautiful day today"

const R1 = content.toString ("hex")

how to convert R1 back to Chinese? Setting utf8 for R1 toString seems to have no effect

Mar.20,2021

you can go back to Buffer before converting to a string.

Menu