The default bug view has changed. See this FAQ.

File System in Sidebar does not display upper ascii directory names

VERIFIED INVALID

Status

()

Core
RDF
P3
critical
VERIFIED INVALID
18 years ago
17 years ago

People

(Reporter: msanz, Assigned: Chris Waterson)

Tracking

Trunk
x86
Windows 95
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: DEPEND - Intl)

(Reporter)

Description

18 years ago
File system in Sidebar does not display directory names that are upper ascii
(nor double-byte).
Create a directory named "téstíñg"
Click on File System on Sidebar and choose the drive where the directory is.
Note that the directory name is now "testing"
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
Target Milestone: M6
(Assignee)

Updated

18 years ago
Assignee: waterson → mcmullen
Status: ASSIGNED → NEW
Target Milestone: M6 → M15
(Assignee)

Comment 1

18 years ago
I am using nsFileSpec, which only has a single-byte interface to get the file
names. Reassigning to John: if you make this double-byte, then I can display
int'l chars.

FWIW, I believe that the file system data source is "out", so I'm going to
change the target milestone on this to something WAY in the future.

Comment 2

18 years ago
OK, so it's academic. But I'd like some pointers on exactly what's required. Is
calling nsString::GetUnicodeString() (or whatever it's called) enough? If so, you
can do it outside of nsFileSpec. I note that all the viewer clients of nsFileSpec
do this extra step themselves (see, for example, nsBrowserWindow.cpp).

Updated

18 years ago
Whiteboard: DEPEND - Intl

Comment 3

18 years ago
Filenames used by the OS' filesystem are encoded in charset encodings specific
to each localized OS.  On Mac: most European filenames are in MacRoman,
Japanese filenames in Shift-JIS.  On Win9x: Euro filename are in MS-Latin1,
Japanese filenames are in Shift-JIS.  On Unix: Euro filenames are in ISO-Latin1,
most Japanese filenames are in EUC-JP.  So we need to determine which encoding
is being used by the file system, so the proper to/from Unicode conversion can
be performed before reading or writing filenames.  nsString are 2-byte Unicode
(w/a special case to allow 1-byte (7-bit) ASCII).   So if nsFileSpec returns
nsString, then it will need to do the proper conversion and not the caller of
nsFileSpec.  This will also hide the platform dependency of the filesystem
encodings.

Updated

18 years ago
Blocks: 7228

Updated

18 years ago
Status: NEW → ASSIGNED

Comment 4

18 years ago
Adding lyecies@netscape.com to cc list.

Updated

18 years ago
Assignee: warren → dougt
Status: ASSIGNED → NEW

Comment 5

18 years ago
Dougt should own this now.

Updated

18 years ago
QA Contact: phillip → paulmac

Comment 6

17 years ago
No, you need to convert char* to PRUnichar* by using Unicode Converter. Find the 
nsIPlatformCharset service and ask for the charset of the FileName selector. 
Then ask Character Converter Manager for an nsIUnicodeDecoder for it. Then you 
convert it from char* to PRUnichar*. 
Naoki have change several code in widget to make the nsIFileWidget work. You may 
look at those code to see how he do that. He convert PRUnichar* to char* by 
using nsIUnicodeEncoder, and you just need the reverse one by using 
nsIUnicodeDecoder. 

Comment 7

17 years ago
The side bar should be using nsIFile.  If it does, strings returned by 
GetPath() are in UTF8.

Comment 8

17 years ago
Where is the code which convert the file system text into UTF8 in nsIFile ?
rjc- yesterday you said you are dealing this this bug ?

Comment 9

17 years ago
Why the method GetPath() passing char* instead of PRUnichar* / nsString ? We 
should always passing PRUnichar* or nsString in the interface for any text which 
may contain non ASCII. The interface problem is bigger than the implementation 
problem. Once the interface is wrong, you need to spend triple time to fix the 
problem. 
ftang: No, this isn't the bug I was referring to.
This bug should dup to BUG 6770.
Probely, this bug will be fixed by BUG 6770's patch.

Comment 12

17 years ago
nsIFile return strings in utf8.  If I create a file called téstíñg, and use an 
ls tool that uses nsIFile, I the path returned is téstíñg.  

This is not a nsIFile bug.

I am reassiging to waterson.  Need to use nsIFile.

(if I am missing something, please let me know)
Assignee: dougt → waterson
(Assignee)

Updated

17 years ago
Status: NEW → ASSIGNED
Target Milestone: M15 → M20

Comment 13

17 years ago
>nsIFile return strings in utf8.  If I create a file called téstíñg, and use 
>an ls tool that uses nsIFile, I the path returned is téstíñg.  
>This is not a nsIFile bug.
>I am reassiging to waterson.  Need to use nsIFile.
This sound exactly like a nsIfile problem....
1. the file system does not use UTF8 as encoding for the file system, so you 
should NOT return UTF8 unless you do explicit conversion between the file system 
charset and UTF-8
2. the file: url historially use file system charset (not UTF-8 again) in 
escaped form. To maintain the compatability with the old file: URL, we should 
treate the %xx escape in file: url as file system charset instead of escaped 
UTF-8. Therefore, the nsIFile better not use UTF-8 but file system charset.

Comment 14

17 years ago
As waterson's said "File System in Sidebar" is OUT now. I cannot find the way to
show the file system in sidebar now.

Comment 15

17 years ago
qa contact to shrir for sidebar bugs
QA Contact: paulmac → shrir
(Assignee)

Comment 16

17 years ago
there are like a million better ways to do this now.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → INVALID

Comment 17

17 years ago
marking verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.