Closed
Bug 341854
Opened 19 years ago
Closed 19 years ago
Copy/Paste unicode file name into firefox need ->NFD normalization
Categories
(Firefox :: Shell Integration, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 325705
People
(Reporter: FrankTang+bugzilla, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
MacOS X store file name in NFD (see http://developer.apple.com/technotes/tn2002/tn2078.html#FSRefsAndLongNames) instead of NFC.
If user copy the file name from finder, the text in the clipboard will be in NFD instead of NFC. so when user paste that into text field, text in NFD get into the form text field. When FireFox submit the form, the NFD get sent out. Therefore, we need
1. adding NFC normalization code when taking text from the clipboard
2. adding NFC normalization code when firefox submitting data
̃
Reproducible: Always
Steps to Reproduce:
1. find a file in the file system, and rename the file as "Îñţérñåţîöñåļîžåţîön" by copying it and paste it.
2. After renaming the file, select the file name again and copy it (you need to copy it from the finder?)
3. find a textfield in FireFox and paste the text into it. You will see the text shown as in NFD not in NFC
Actual Results:
the text Îñţérñåţîöñåļîžåţîön no longer looks like Îñţérñåţîöñåļîžåţîön
Every combing mark on that string will be decomposed.
Expected Results:
all the text stay in NFC and looks like Îñţérñåţîöñåļîžåţîön
add NFC normalization code to
http://lxr.mozilla.org/seamonkey/source/widget/src/mac/nsClipboard.cpp#523
around
517 if ( (macOSFlavor == 'utxt') &&
518 (dataSize > 2) &&
519 ((clipboardDataPtr[0] == 0xFE && clipboardDataPtr[1] == 0xFF) ||
520 (clipboardDataPtr[0] == 0xFF && clipboardDataPtr[1] == 0xFE)) ) {
521 dataSize -= sizeof(PRUnichar);
522 clipboardDataPtr += sizeof(PRUnichar);
523 }
524
525 // put it into the transferable
526 nsCOMPtr<nsISupports> genericDataWrapper;
527 nsPrimitiveHelpers::CreatePrimitiveForData ( flavorStr, clipboardDataPtr, dataSize, getter_AddRefs(genericDataWrapper) );
528 errCode = aTransferable->SetTransferData ( flavorStr, genericDataWrapper, dataSize );
Comment 1•19 years ago
|
||
*** This bug has been marked as a duplicate of 325705 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•