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
If you are able to use 3rd party libraries, have a look at the ICU library from IBM:
http://site.icu-project.org/