Closed
Bug 105704
Opened 24 years ago
Closed 24 years ago
searching with int chars produces IMAP error
Categories
(SeaMonkey :: MailNews: Message Display, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9.6
People
(Reporter: bugzilla, Assigned: nhottanscp)
Details
(Keywords: intl, regression)
Attachments
(1 file)
|
738 bytes,
patch
|
naving
:
review+
alecf
:
superreview+
|
Details | Diff | Splinter Review |
when I do a search for "inge spø" on my software.com IMAP server I get an error.
The IMAP log tell the story:
11 uid SEARCH CHARSET %S UNDELETED HEADER SUBJECT "inge spø"
11 BAD Missing required argument to UID SEARCH
should the %S be substituted with something?
build 20011018
Comment 1•24 years ago
|
||
cc'ing nhotta. Naoki, are you able to reproduce this?
| Assignee | ||
Comment 2•24 years ago
|
||
I tried i18n smoke test data on IMAP, searching "Santé" worked, I did not see
the error.
Cc to taka, he knows about i18n IMAP search.
| Reporter | ||
Comment 3•24 years ago
|
||
Could you post the IMAP command Mozilla send when you search.
My IMAP commands are when searching for test:
uid SEARCH UNDELETED HEADER SUBJECT "test"
and when searching for testø
uid SEARCH CHARSET %S UNDELETED HEADER SUBJECT "testø"
somehow Mozilla fail to get the charset that was gonna be substituted into %S
Henrik, what's you global mail display encoding in Preferences | Mail &
Newsgroup | Message Display pane? It should be consistent with the encoding of
the mail you search.
| Reporter | ||
Comment 5•24 years ago
|
||
everything is "western (iso-8859-1)"
| Assignee | ||
Comment 6•24 years ago
|
||
Henrik, do you know where to put a break point to see the string sent by Mozilla?
| Reporter | ||
Comment 7•24 years ago
|
||
I'm using mozilla installer. But according to the code, it seems like mozilla
somehow doesn't get my charset and therefor substitutes %S with nothing.
| Assignee | ||
Comment 8•24 years ago
|
||
I think somewhere around here, getting a charset, I will try once my build in done.
http://lxr.mozilla.org/seamonkey/source/mailnews/base/search/src/nsMsgImapSearch.cpp#59
| Assignee | ||
Comment 9•24 years ago
|
||
I got the same problem using the trunk. I was using 0.9.4 branch for my last test.
The following code, destCharset is PRUnichar*, it used to convert it to char*.
Now, it passes PRUnicode* with %S.
165 // Specify a character set unless we happen to be US-ASCII.
166 if (nsCRT::strcmp(destCharset, NS_LITERAL_STRING("us-ascii").get()))
167 result = PR_smprintf("%s%S", nsMsgSearchAdapter::m_kImapCharset, destCharset);
I think this is releated to nsMsgSearchAdapter.cpp, rev=1.35, cc to alecf.
Is "%S" supposed to be used for PRUnichar*?
I changed llocally to convert to char* then it works.
Index: nsMsgSearchAdapter.cpp
===================================================================
RCS file: /cvsroot/mozilla/mailnews/base/search/src/nsMsgSearchAdapter.cpp,v
retrieving revision 1.39
diff -u -r1.39 nsMsgSearchAdapter.cpp
--- nsMsgSearchAdapter.cpp 2001/10/10 21:17:57 1.39
+++ nsMsgSearchAdapter.cpp 2001/10/24 23:00:29
@@ -164,7 +164,7 @@
// Specify a character set unless we happen to be US-ASCII.
if (nsCRT::strcmp(destCharset, NS_LITERAL_STRING("us-ascii").get()))
-
result = PR_smprintf("%s%S", nsMsgSearchAdapter::m_kImapCharset, destCharset);
+
result = PR_smprintf("%s%s", nsMsgSearchAdapter::m_kImapCharset,
NS_ConvertUCS2toUTF8(destCharset).get());
return result;
}
Keywords: intl,
regression
Comment 11•24 years ago
|
||
hrmm.. does that actually fix the problem? %S is supposed to refer to unicode,
but isn't destCharset a PRUnichar*? I say that only because the strcmp() is
taking a const PRUnichar* as its first parameter.
| Assignee | ||
Comment 12•24 years ago
|
||
http://lxr.mozilla.org/seamonkey/source/mailnews/base/search/src/nsMsgSearchAdap
ter.cpp#161
161 nsMsgSearchAdapter::GetImapCharsetParam(const PRUnichar *destCharset)
Yes, destCharset is PRUnichar*. PR_smprintf doesn't seem to understand "%S" but
I am not sure. Alec, where did you know %S takes PRUnichar*, any documentation?
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.6
Comment 13•24 years ago
|
||
ack, I'm sorry, I was confusing PR_smprintf, which is an NSPR routine and
doesn't understand any unicode, with nsTextFormatter::smprintf, which is an
xpcom routine and understands PRUnichar* and %S.
so now I understand why your code works :)
sr=alecf if you need it.
| Assignee | ||
Comment 14•24 years ago
|
||
Comment 15•24 years ago
|
||
Comment on attachment 55081 [details] [diff] [review]
Changed to pass char* to PR_smprintf() instead of PRUnichar*.
sr=alecf
Attachment #55081 -
Flags: superreview+
Comment 16•24 years ago
|
||
Comment on attachment 55081 [details] [diff] [review]
Changed to pass char* to PR_smprintf() instead of PRUnichar*.
r=naving
Attachment #55081 -
Flags: review+
| Assignee | ||
Comment 17•24 years ago
|
||
Checked in to the trunk.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 18•24 years ago
|
||
OK using nov19 commercial trunk build: win98, liunux rh6.2 and mac OS X.
Status: RESOLVED → VERIFIED
Updated•21 years ago
|
Product: Browser → Seamonkey
Component: MailNews: Search → MailNews: Message Display
QA Contact: laurel → search
You need to log in
before you can comment on or make changes to this bug.
Description
•