Archived

This topic is now archived and is closed to further replies.

Abominus

2 MBCS questions

Recommended Posts

1. Is there a non-Visual C specific function for moving to the next or previous character in an MBCS string (something like the equivalent of _mbsinc and _mbsdec but not VC-specific) 2. Does strlen return the number of characters or number of bytes in an MBCS string? If it returns characters, how do I calculate the number of bytes? If it returns bytes, how do I calculate the number of characters?

Share this post


Link to post
Share on other sites
quote:
Original post by Abominus
1. Is there a non-Visual C specific function for moving to the next or previous character in an MBCS string (something like the equivalent of _mbsinc and _mbsdec but not VC-specific)


Win32 has CharNext and CharPrev.
quote:

2. Does strlen return the number of characters or number of bytes in an MBCS string? If it returns characters, how do I calculate the number of bytes? If it returns bytes, how do I calculate the number of characters?

strlen will return the number of characters in an SBCS string, and I suppose the number of bytes in an MBCS string. _mbslen will return the number of characters in an MBCS string.

---
Come to #directxdev IRC channel on AfterNET

Share this post


Link to post
Share on other sites
quote:
Original post by niyaw
[quote]Original post by Abominus
1. Is there a non-Visual C specific function for moving to the next or previous character in an MBCS string (something like the equivalent of _mbsinc and _mbsdec but not VC-specific)


Win32 has CharNext and CharPrev.

What abt non-Win32 specific functions? Are there any functions in the ISO C library which deal with this?

quote:


2. Does strlen return the number of characters or number of bytes in an MBCS string? If it returns characters, how do I calculate the number of bytes? If it returns bytes, how do I calculate the number of characters?

strlen will return the number of characters in an SBCS string, and I suppose the number of bytes in an MBCS string. _mbslen will return the number of characters in an MBCS string.

--
Come to #directxdev IRC channel on AfterNET

Thanks...but once again, I need non-Win32/VC specific functions.

[edited by - Abominus on July 16, 2002 2:06:48 PM]

Share this post


Link to post
Share on other sites
Standard C routines for multibyte string manipulation? Never heard of them, and an inspection of standard header files reveals no traces of them either. If you are positive that they exist, open your header files and look inside.

---
Come to #directxdev IRC channel on AfterNET

Share this post


Link to post
Share on other sites
quote:
Original post by niyaw
Standard C routines for multibyte string manipulation? Never heard of them, and an inspection of standard header files reveals no traces of them either. If you are positive that they exist, open your header files and look inside.

---
Come to #directxdev IRC channel on AfterNET


I think the Standard defines something like an mblen function but I''m not too sure (my docs are outdated).

Share this post


Link to post
Share on other sites