Opened 14 years ago

Closed 8 years ago

#2792 closed defect (fixed)

wxURI's BUG

Reported by: wxmjohn Owned by:
Priority: normal Milestone:
Component: base Version:
Keywords: wxURI Cc: wxmjohn, gerryi
Blocked By: Blocking:
Patch: no

Description

wxURI can't deal with Asia language at UNICODE
version.
(I have read the tracker 1213147, I suppose the
isEsacpe has no problem).

for example.

  1. this url:

ftp://plinux.org/incoming/!Ebooks/Ansys%D6%D0%CE%
C4%BD%CC%B3%CC/ANSYS%C5%E0%D1%B5%
BD%CC%B3%CC.zip.

%C5%E0,
%D1%B5,
%BD%CC,
%B3%CC,
are four chinese words, there ANSI code are
0xc5ed,0xd1b5,0xbdcc,0xb3cc.

after use url.Unescape() or BuildUnescapedURI(), the
right dealing should be:
transfer ansi code 0xc5ed to UNICODE then save it in
One wchar_t,
transfer ansi code 0xd1b5 to UNICODE then save it in
One wchar_t,
transfer ansi code 0xbdcc to UNICODE then save it in
One wchar_t,
transfer ansi code 0xb3cc to UNICODE then save it in
One wchar_t,.

but at the present time.
the wxURI's dealing is:
after use url.Unescape() or BuildUnescapedURI()
save 0xC5E0 it in two wchar_t(0xC5 in one
wchar_t,0xE0 in one wchar_t),
save 0xD1B5 it in two wchar_t,
save 0xBDCC it in two wchar_t,
save 0xC5E0 it in two wchar_t,
this is not right.

  1. In UNICODE version, If url has chinese words.

After get the url's value from textboxl and save it in a
wxString value. all the chinese word's code changed to
UNIOCDE, then when save it to wxURI, wxURI would use
escape to the UNIOCDE value. if send the escaped
string to server, the server would not understand it.
because reference to RFC1738, i think whether server or
client shoud escape or unesacpe ansi code not unicode.
ansi code not equal to UNICODE.

so i think shoud use char not wchat_t in
wxURI,wxHTTP....

Change History (4)

comment:1 Changed 13 years ago by gerryi

This also affects file drag and drop because it uses file:
URIs internally and wxFileDataObject::SetData doesn't
convert them properly when they are escaped UTF8.

comment:2 Changed 12 years ago by wojdyr

  • Component set to base
  • Keywords wxURI added

comment:3 Changed 8 years ago by oneeyeman

Is there people who speaks Chinese? Can someone please verify that this is still the case?

comment:4 Changed 8 years ago by vadz

  • Cc vadz removed
  • Resolution set to fixed
  • Status changed from new to closed

I think this should have been fixed by r54723 (see #3874).

Note: See TracTickets for help on using tickets.