Re: multibyte length
- From: Micah Cowan <micah@xxxxxxxxxx>
- Date: Fri, 03 Mar 2006 22:51:55 GMT
Jordan Abel <random832@xxxxxxxxx> writes:
On 2006-03-03, Micah Cowan <micah@xxxxxxxxxx> wrote:
Jordan Abel <random832@xxxxxxxxx> writes:
Is there a function to find the length, in wide characters, of a
multibyte string?
<OT>
If you have the POSIX version of mbstowcs, you can pass it a NULL
first argument to get this number.
Given that this came up when i was trying to answer someone's question
in c.u.p, this is relevant, thanks.
</OT>
If you limit yourself to Standard C, I think you have to actually
perform the conversion, and then find out with wcslen().
The reason for this was to be able to perform the conversion into memory
that is from malloc while calling malloc only once. in order to make a
wide copy of argv to pass to a "wmain"
Makes sense to me: snprintf() allows this. It's beyond me why Standard
C neglected to provide such a thing in the first place. I kind of hope
that future versions will add the POSIX behavior, as it's very useful,
and certainly not hard to implement.
.
- References:
- multibyte length
- From: Jordan Abel
- Re: multibyte length
- From: Micah Cowan
- Re: multibyte length
- From: Jordan Abel
- multibyte length
- Prev by Date: Re: Ceil double problem
- Next by Date: Re: 2 questions about struct copy
- Previous by thread: Re: multibyte length
- Next by thread: Passing args to main( )
- Index(es):
Relevant Pages
|