On Sun, Sep 12, 2010 at 5:30 AM, Chunlin Zhang <zhangchun...@gmail.com> wrote:
> Now I want to use wxTextCtrl:GetInsertionPoint() to get input point,but I 
> found
> that GetInsertionPoint is using character to count,not byte.So the result of
> GetInsertionPoint() is not suitable to use in wxTextCtrl string ,because
> wxTextCtrl string is lua string.
>
> For example,the system default encoding is UTF-8,when wxTextCtrl string have
> some muti-bytes character for example chinese characters,the 
> GetInsertionPoint()
> result can not use in lua string.
>
> How can I do with this situation?

I don't really know or even if wxString handles it appropriately? If
you don't expect the text to be too long you could loop through
wxTextCtrl::GetText() and count chars. Depending on what you want,
would wxTextCtrl::GetRange() help figure out the position?

http://en.wikipedia.org/wiki/UTF-8

Regards,
    John

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to