| From: | Dave Page <dpage(at)postgresql(dot)org> | 
|---|---|
| To: | Erwin Brandstetter <brandstetter(at)falter(dot)at> | 
| Cc: | pgadmin-hackers(at)postgresql(dot)org | 
| Subject: | Re: Character miscount | 
| Date: | 2007-05-08 08:21:03 | 
| Message-ID: | 464032EF.9000702@postgresql.org | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgadmin-hackers | 
Erwin Brandstetter wrote:
> Hi developers! Hi Dave!
> 
> Testing pgAdmin III v1.6.3 rev: 6112, client Win XP, host: Debian Sarge, 
> PG 8.1.9.
> 
> A pretty useful feature in the SQL query dialogue displays data about 
> the current position of the cursor.
> 
>        Ln 168 Col 30 Ch 7596
> 
> "Ch" supposably stands for "Characters".
Yes.
> However, it is not the correct character count, but (supposably) the 
> byte-length of the string. Multibyte-characters (like German umlauts ö ä 
> ü) mess with the count. I stumbled across this while trying hard to fix 
> a functions that wouldn't return the right length of a string. Turns 
> out, the function was right, pgAdmin was wrong.
Argh - it's wxSTC::GetCurrentPos() returning the wrong value. I imagine 
it's related to the previous bug which I logged with the wx guys: 
http://sourceforge.net/tracker/index.php?func=detail&aid=1598444&group_id=9863&atid=109863
> I have reported appearances of this phenomenon in various places (and 
> Dave has fixed them) in the past. Maybe you can identify a typical 
> function or word to look for in all of the source code to find other 
> instances of the beast? (Just a thought.)
The workaround used previously involved wxSTC::SetSelection(), and 
basically not using it any more. Unfortunately there is no similar fix 
that I can think of for this case. I'll add some info on the issue to 
the wx bug and note it in our bugs file. I'm not sure there's much else 
I can do I'm afraid :-(
Thanks for the report though.
Regards, Dave.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | svn | 2007-05-08 08:22:37 | SVN Commit by dpage: r6266 - trunk/pgadmin3 | 
| Previous Message | ivan.pavlov | 2007-05-07 10:36:43 | Re: compile problems |