randexp.js icon indicating copy to clipboard operation
randexp.js copied to clipboard

fromCodePoint

Open MichielCM opened this issue 7 years ago • 2 comments

Hi there,

Nice library! Just a quick suggestion: you may consider using fromCodePoint rather than fromCharCode so UTF-8 characters can be supported. :)

MichielCM avatar Mar 15 '18 13:03 MichielCM

That's not necessary. Supplementary plane code points are already supported. What's not working for you?

michaelficarra avatar Mar 15 '18 16:03 michaelficarra

When I set the default range to a high integer (e.g. 18943) it doesn't produce a character.

Seems obvious, since fromCharCode doesn't support the highest Unicode values.

Compare these: document.write(String.fromCodePoint(194564)); document.write(String.fromCharCode(194564));

MichielCM avatar Mar 17 '18 15:03 MichielCM