Closed Bug 22116 Opened 25 years ago Closed 25 years ago

view mistaking URL when 0x5c is used at second charactor

Categories

(Core :: XPCOM, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: m_kato, Assigned: ftang)

References

Details

Attachments

(1 file)

- reproduce step 1. make a directry and html file to c:\ソソ\a.html 2. select this file via [File] - [Open File...] - result URL bar is file:///C|/%83/%83//a.html. This should view "file:///C|/%83%5C%83%5C/a.html" [ソ] is [0x83], [0x5c] at ShiftJIS. And 0x5c is second byte of ShiftJIS (not file separator). I think that this problem is occured since nsFilePath and nsSimpleCharString don't use unicode(PRUnichar).
Assignee: dp → ftang
Summary: view mistaking URL when 0x5c is used at second charactor → view mistaking URL when 0x5c is used at second charactor
Frank can you help us with this.
Assignee: ftang → bobj
Hum.... this is a tough one. I am not sure which way is BETTER or correct than the other. I try to copy adn paste file:///C|/%83/%83//a.html into 4.x and 4.x can still visit that page. Not that sure we should fix it. bobj- any opinion ?
Target Milestone: M13
0x5C should not be interpreted as a path separator when it is the 2nd byte of a legitimate SJIS character. But in this example, this is not the case. What happens when we have a pathname with legitimate 2-byte SJIS characters which contain 0x5C as the 2nd byte? Does that work? If so, then I don't think there is a problem with the described behavior.
QA Contact: dp → teruko
Status: NEW → ASSIGNED
Teruko, Will you please have someone verify this bug? Please test with sequences of valid SJIS kanji and kana. See my last comment/question. (Changed QA assigned to Teruko and moved dp to cc list.)
Ignore my last 2 comments (12/20 and 12/31). I misread the previous comments. This is a good bug. We should see the file name in Japanese in the URL bar after selecting it via the file picker. We probably need to determine the file system character encoding via the OS localization (ACP on Win, System Script on Mac, user locale on Unix?) and then convert to Unicode for DISPLAY in the URL bar. The actual URL should probably remain as-is: %-encoded using the numeric values based upon the file system character encoding. Will someone please confirm that the %-encoded URL currently being displayed will actually open the correct file?
It does open a local file even when the path name contains 5C as part of a JPN named directory.
The display in the Location field should be in Japanese if viewed under Japanese Windows -- maing assumption about the file-system charset. The otehr problem is that of display of actual URL. Currently, %83%5C is displayed/recorded as "%83/" meaning we are showing all ASCII range codepoint using the real ASCII characters rather than the escaped equivalent. I think we should esacpe these as m_kato suggests.
Assignee: bobj → erik
Status: ASSIGNED → NEW
Target Milestone: M13 → M14
Reassigned to erik for M14
Status: NEW → ASSIGNED
At first, we should fix BUG 5887 ?
I don't think Filesystem in the sidebar is currently a supported feature. So at present there will be nothing to fix in Bug 5887.
Change Platform ans OS to ALL
OS: Windows NT → All
Hardware: PC → All
Probebly, OS is Windows 9x / NT / 2K only. File separater is '\' and it uses SJIS encoding. A easy huck uses IsDBCSLeadByte in nsFilePath. But I don't think that this huck is correct. True implementation should use Unicode in nsFilePath and nsSimpleCharString. VFAT and NTFS have the unicode filename. So I don't know whether 0x83 is lead charactor of DBCS.
Keywords: beta1
Putting on PDT- radar for beta1. Would not hold beta, but erik, please get with rickg to get rid simple char string, replace with ns string.
Whiteboard: [PDT-]
I agree with m_kato that 5887 should be fix first.
Keywords: beta1
Whiteboard: [PDT-]
Target Milestone: M14 → M15
probably a dup of 28171
Attached patch a easy patch (deleted) — Splinter Review
Non, this problem is nsFileSpec. See prev comment.
Frank, was this bug addressed by your recent URL work?
Assignee: erik → ftang
Status: ASSIGNED → NEW
Target Milestone: M15
This is fixed by 28171 and 6770 *** This bug has been marked as a duplicate of 6770 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Please retest now that bug 28171 and bug 6770 have been fixed.
It isn't fixed!!! this issue isn't bug 6770 and bug 28171. This problem is nsFileSpecHelpers::NativeToUnix - env. o Mozilla M15 2000031306 o Windows NT WKS 4.0 SP6a JPN - repro step 1. create C:\テスト\ソソ.htm 2. open this file via [File] - [Open File...] - result o URL bar is file:///C|/%83e%83X%83g/%83/%83/.htm o Cannot open this file.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
m_kato, do you know how to fix it ? Can you point me the problematic code. (file/line/function) thanks.
Status: REOPENED → ASSIGNED
It is worst now. The file:/// is complete broken in M15 for non ASCII . I will only get file:///c|/ if the directory name is in non ASCII. I think this is related to the recent change of nsIFile
mark it M16
Target Milestone: --- → M16
all the nsIFile and nsIFileSpec related issue should be look together.
Blocks: 34654
Keywords: beta2
Frank, don't waste any time on nsIFileSpec or nsFileSpec. This interface and class have been deprecated. nsIFile and nsILocalFile is the one true way.
I think this bug have already been fix because 1. other change code from using nsFileSpec to nsILocalFile 2. we check in fix inside nsStdURL The Composer is now still using the nsFileSpec, but I neither can reproduce the problem because the Unicode Path I got is %hh encoded alread. Mark this bug fixed.
Keywords: nsbeta2
fix and check in.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago25 years ago
Keywords: beta2
Resolution: --- → FIXED
I verified this in 2000042709 Win32 and Linux, and 2000042710 Mac builds.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: