Number of character cells used by string

前端 未结 6 749
离开以前
离开以前 2020-12-02 14:56

I have a program that outputs a textual table using UTF-8 strings, and I need to measure the number of monospaced character cells used by a string so I can align it properly

6条回答
  •  遥遥无期
    2020-12-02 15:23

    If you are able to use 3rd party libraries, have a look at the ICU library from IBM:

    http://site.icu-project.org/

提交回复
热议问题