I need to add a UTF-8 byte-order-mark to generated text data on client side. How do I do that?
Using new Blob(['xEFxBBxBF' + content])
yields '???"my data"'
, of course.
Neither did 'uBBEFx22BF'
work (with 'x22' == '"'
being the next character in content
).
Is it possible to prepend the UTF-8 BOM in JavaScript to a generated text?
Yes, I really do need the UTF-8 BOM in this case.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…