Discussion:
Number of bytes in UTF8 build
Igor Korot
2014-06-26 19:39:52 UTC
Permalink
Hi, ALL,
According to http://wiki.wxwidgets.org/Development:_UTF-8_Support, part "

UTF-8 based wxString implementation", length() return " number of
characters, not the length of C string used to represent it", and not
number of bytes.


How do I get number of bytes in a string in a UTF8 build?

The question comes from the fact that XmbTextExtents() third parameter takes
number of bytes. (ref.
http://www.x.org/archive/X11R7.5/doc/man/man3/XmbTextExtents.3.html).

Thank you.
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-06-26 19:42:54 UTC
Permalink
On Thu, 26 Jun 2014 12:39:52 -0700 Igor Korot wrote:

IK> How do I get number of bytes in a string in a UTF8 build?

Using wxString::utf8_str().length().

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Loading...