Closed Bug 105704 Opened 24 years ago Closed 24 years ago

searching with int chars produces IMAP error

Categories

(SeaMonkey :: MailNews: Message Display, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.6

People

(Reporter: bugzilla, Assigned: nhottanscp)

Details

(Keywords: intl, regression)

Attachments

(1 file)

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
cc'ing nhotta. Naoki, are you able to reproduce this?
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.
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.
everything is "western (iso-8859-1)"
Henrik, do you know where to put a break point to see the string sent by Mozilla?
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.
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
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
over to nhotta, who is closer to the fix.
Assignee: naving → nhotta
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.
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
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.
Comment on attachment 55081 [details] [diff] [review] Changed to pass char* to PR_smprintf() instead of PRUnichar*. sr=alecf
Attachment #55081 - Flags: superreview+
Comment on attachment 55081 [details] [diff] [review] Changed to pass char* to PR_smprintf() instead of PRUnichar*. r=naving
Attachment #55081 - Flags: review+
Checked in to the trunk.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
OK using nov19 commercial trunk build: win98, liunux rh6.2 and mac OS X.
Status: RESOLVED → VERIFIED
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.

Attachment

General

Creator:
Created:
Updated:
Size: