React Javascript displaying/decoding unicode characters

后端 未结 5 1398
日久生厌
日久生厌 2021-01-03 20:13

I have a string in unicode that i need to convert. I need to render the string with \\u00f3 to ó. This is an example, it should happen with all other types of characters, á

5条回答
  •  心在旅途
    2021-01-03 20:58

    To put the unicode write in your render() and jsx, you can just:

    {'First \u00b7 Second'}

    , or

    {'First ' + String.fromCharCode(183) + ' Second'}

    If doing this with libraries and other fonts, be sure that your font is imported first, make sure that you are using font-family: myFont (i.e. "Font Awesome 5 Free"). And make sure that the unicode that you are using is accurate.

提交回复
热议问题