Filenames encoding ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Filenames encoding ?

Rémi-2

What should be the encoding used for filenames in FUSE ? i.e. how do I guess
how the filenames will be presented to the user of the filesystem ?
Is there any translation applied by VFS or FUSE on the filenames supplied ?

Context : I implement a filesystem where filenames are based on data received
from an external system, encoded using some charset e.g. utf-8.




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Filenames encoding ?

Miklos Szeredi
> What should be the encoding used for filenames in FUSE ? i.e. how do
> I guess how the filenames will be presented to the user of the
> filesystem ?

The filesystem should not care.  It should treat filenames as binary
blobls of data, and not try to interpret character encoding.

> Is there any translation applied by VFS or FUSE on the
> filenames supplied ?

No.

> Context : I implement a filesystem where filenames are based on data
> received from an external system, encoded using some charset
> e.g. utf-8.

In that case, you either force the user to use the same encoding as
the underlying filesystem, or implement conversions in your filesystem
using libiconv, based on mount options or locale settings.

Miklos


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Filenames encoding ?

Rémi-2

>
> > Context : I implement a filesystem where filenames are based on data
> > received from an external system, encoded using some charset
> > e.g. utf-8.
>
> In that case, you either force the user to use the same encoding as
> the underlying filesystem, or implement conversions in your filesystem
> using libiconv, based on mount options or locale settings.
>
> Miklos

ok. I suspect though that the end user is not free to choose any encoding : my
filesystem should still return filename strings where vfs or fuse can find or
store the '/' and '\0' characters i.e. this rules out filenames encoded in
UTF-16 for example. Am I correct ?


--
Rémi


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Filenames encoding ?

Miklos Szeredi
> ok. I suspect though that the end user is not free to choose any
> encoding : my filesystem should still return filename strings where
> vfs or fuse can find or store the '/' and '\0' characters i.e. this
> rules out filenames encoded in UTF-16 for example. Am I correct ?

Yes.  Obviously any encoding not compatible with ascii will not really
work.

Miklos


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Loading...