Re: Filename containing French characters ?

2011-05-24 Thread Frank Bonnet

OK now the filenames are well displayed in the console
\BUT ...

It still does not work with apache ( 404 file not found ! )

here is the log of apache when trying to access a filename
that contains those bloody characters



82.238.8.126 - - [24/May/2011:06:56:01 +0200] GET 
/cv/ESIEE_MANAGEMENT/Systeme_information/11_EM2_SI_JUIN_CV_AMICHIA_Anthony%20Aim%C3%A9e%20Marthe%20Moteh.docx 
HTTP/1.1 404 1337


The problem comes from the %C3%A9e character ( e eacute )

apache is unable to open that filename


On 05/24/2011 06:44 AM, Frank Bonnet wrote:

Thanks that is working :-)

Now I have to test the application ( apache based application )
to see if it is able to open the file.

I'll tell in few hours when arrived to my office


Le 23/05/2011 17:50, Modulok a écrit :
Short answer, use a glob pattern. Assume I have a file named 'à 
fichier.txt':


 ls -l
 -rw-r--r--  1 Modulok  Modulok   12 May 23 09:01 ?? fichier.txt

 mv ?\ fichier.txt aFile.txt

Long answer, for those who want to follow along and fix their 
terminal to

display UTF-8, keep reading...

Step 1: Make a funky file to play along with this min-tutorial:
===

Create a text file with an editor that supports non-ASCII characters. I
created a file named 'filename' which containing this (no newline!):

 à fichier.txt

Step 2: Create the actual file with content
===

I used echo and cat like so in the tcsh shell:

 echo hello world  `cat filename`


Step 3: Show the file in ls
===

As you can see below, the first character of the filename is 
displayed as two
question marks. This is the terminal's way of showing filenames that 
it cannot
display correctly. There are two question marks, because this is a 
two-byte
character. This does *not* mean the filename starts with a literal 
question

mark:


 -rw-r--r--  1 Modulok  Modulok   12 May 23 09:01 ?? fichier.txt

Step 4: (optional) Fix the terminal
===

At this point, let's just fix the terminal so that UTF-8 characters are
displayed correctly. We want to see the French accented 'à', and not 
a bunch of
question marks. To do this, you edit '/etc/login.conf' as root. Add 
two lines
at the bottom of the 'default' section. My default section now looks 
like this:



 default:\
 :passwd_format=md5:\
 :copyright=/etc/COPYRIGHT:\

 ...and so on...

 :charset=en_US.UTF-8:\
 :lang=en_US.UTF-8:

If you're a French operation yours should probably look like this 
instead:


 default:\
 :passwd_format=md5:\
 :copyright=/etc/COPYRIGHT:\

 ...and so on...

 :charset=fr_FR.UTF-8:\
 :lang=fr_FR.UTF-8:

I'm not certain on these for all countries, but the above examples 
work. We
then need to rebuild the actual login database. Execute the following 
command

as root:

 cap_mkdb /etc/login.conf

This generates /etc/login.conf.db from /etc/login.conf. Now log out 
and then

back in!


Step 5: Back to the funky file
==

You should now see the actual accent characters correctly in the 
terminal.

(Assuming your terminal supports this):

 -rw-r--r--  1 Modulok  Modulok   12 May 23 09:01 à fichier.txt

In some ternimals, we cannot type these characters. So you can access 
the
filename through a shell glob pattern. In most shells, the glob 
pattern '?'

matches any single character. The forward slash escapes the space in the
filename.

 mv ?\ fichier.txt aFile.txt


Hope this helps (and doesn't get too mangled.)
-Modulok-

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
freebsd-questions-unsubscr...@freebsd.org



--

Frank BONNET

01.45.92.66.17

Service des Moyens Informatiques Generaux

ESIEE PARIS
Cité Descartes / BP 99
93162 NOISY-LE-GRAND Cedex
http://www.esiee.fr http://www.esiee.fr/

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-24 Thread Robert Bonomi
 From owner-freebsd-questi...@freebsd.org  Tue May 24 02:32:36 2011
 Date: Tue, 24 May 2011 09:32:20 +0200
 From: Frank Bonnet f.bon...@esiee.fr
 To: freebsd-questions@freebsd.org
 Subject: Re: Filename containing French characters ?

 OK now the filenames are well displayed in the console
 \BUT ...

 It still does not work with apache ( 404 file not found ! )

 here is the log of apache when trying to access a filename that contains 
 those bloody characters



 82.238.8.126 - - [24/May/2011:06:56:01 +0200] GET
 /cv/ESIEE_MANAGEMENT/Systeme_information/11_EM2_SI_JUIN_CV_AMICHIA_Anthony
 %20Aim%C3%A9e%20Marthe%20Moteh.docx HTTP/1.1 404 1337

 The problem comes from the %C3%A9e character ( e eacute )

Please show the output of 
  ls -lb /cv/ESIEE_MANAGEMENT/Systeme_information/11_EM2_SI_JUIN_CV_AMICHIA*
and 
 ls -lb /cv/ESIEE_MANAGEMENT/Systeme_information/11_EM2_SI_JUIN_CV_AMICHIA* \
 | od -xc

And, also with {DOCROOT} (whatever it is) prepended to the paths shown above.

*AlSO* show your apache configuration file -- especially what 'DOCROOT' is.

Lastly, do you have _any_ path-rewriting rules that might result in a
different _actual_ path than the 'requested' one?  Virtually =every- Apache
installation has at least one such rewrite rule.

Please show _all_ such rules/transformations.



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-24 Thread Frank Bonnet

On 05/24/2011 10:01 AM, Robert Bonomi wrote:

 From owner-freebsd-questi...@freebsd.org  Tue May 24 02:32:36 2011
Date: Tue, 24 May 2011 09:32:20 +0200
From: Frank Bonnetf.bon...@esiee.fr
To: freebsd-questions@freebsd.org
Subject: Re: Filename containing French characters ?

OK now the filenames are well displayed in the console
\BUT ...

It still does not work with apache ( 404 file not found ! )

here is the log of apache when trying to access a filename that contains
those bloody characters



82.238.8.126 - - [24/May/2011:06:56:01 +0200] GET
/cv/ESIEE_MANAGEMENT/Systeme_information/11_EM2_SI_JUIN_CV_AMICHIA_Anthony
%20Aim%C3%A9e%20Marthe%20Moteh.docx HTTP/1.1 404 1337

The problem comes from the %C3%A9e character ( e eacute )

Please show the output of
   ls -lb /cv/ESIEE_MANAGEMENT/Systeme_information/11_EM2_SI_JUIN_CV_AMICHIA*



ls -lb 11_EM1_SI_AMI*
ls: No match



and
  ls -lb /cv/ESIEE_MANAGEMENT/Systeme_information/11_EM2_SI_JUIN_CV_AMICHIA* \
  | od -xc
ls -lb 
/cv/ESIEE_MANAGEMENT/Systeme_information/11_EM2_SI_JUIN_CV_AMICHIA* | od -xl

ls: No match.

ls -lb in the directory give that :

-rw-r--r--  1 www-data  www-data   18294 24 mai 03:00 
11_EM2_SI_JUIN_CV_AMICHIA_Anthony Aim\351e Marthe Moteh.docx


but wildcards fails as you can see in preceding lines.


And, also with {DOCROOT} (whatever it is) prepended to the paths shown above.


DOCROOT is OK all files that does not contains accentuated characters
are well opened and displayed in web pages.


*AlSO* show your apache configuration file -- especially what 'DOCROOT' is.

Lastly, do you have _any_ path-rewriting rules that might result in a
different _actual_ path than the 'requested' one?  Virtually =every- Apache
installation has at least one such rewrite rule.



no rewriting rules a all


Please show _all_ such rules/transformations.






--

Frank BONNET

01.45.92.66.17

Service des Moyens Informatiques Generaux

ESIEE PARIS
Cité Descartes / BP 99
93162 NOISY-LE-GRAND Cedex
http://www.esiee.fr http://www.esiee.fr/

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French Characters

2011-05-24 Thread Robert Bonomi

 Date: Tue, 24 May 2011 10:28:02 +0200
 From: Frank Bonnet f.bon...@esiee.fr
 Subject: Re: Filename containing French characters ?

 On 05/24/2011 10:01 AM, Robert Bonomi wrote:
   From owner-freebsd-questi...@freebsd.org  Tue May 24 02:32:36 2011 
   Date: Tue, 24 May 2011 09:32:20 +0200 From: Frank 
   Bonnetf.bon...@esiee.fr To: freebsd-questions@freebsd.org Subject: 
   Re: Filename containing French characters ?
 
  OK now the filenames are well displayed in the console
  \BUT ...
 
  It still does not work with apache ( 404 file not found ! )
 
  here is the log of apache when trying to access a filename that 
  contains those bloody characters
 
  82.238.8.126 - - [24/May/2011:06:56:01 +0200] GET
  /cv/ESIEE_MANAGEMENT/Systeme_information/11_EM2_SI_JUIN_CV_AMICHIA_Ant=
 hony
  %20Aim%C3%A9e%20Marthe%20Moteh.docx HTTP/1.1 404 1337
 
  The problem comes from the %C3%A9e character ( e eacute )

Not surprising, there is _no_ %C3%A9e character in the file name.  grin

 ls -lb in the directory give that :

 -rw-r--r--  1 www-data  www-data   18294 24 mai 03:00 
 11_EM2_SI_JUIN_CV_AMICHIA_Anthony Aim\351e Marthe Moteh.docx

 but wildcards fails 

Ah so.  

There is an 'unfortunate' line-break in the ls output you show. This may
be *VERY* significant.  IF what is shown above _is_ *exactly* how the output 
appears, then there is a '[NL]' as the first character of the filename. In 
_that_ case, putting a '?' or '*' on the front of the wildcard string 
_should_ expand to the actual file nam.  That is, ls -lb ?11_EM2* should 
succeed.

OTOH, *IF* the ls -lb output appears as one long line, please check the 
output _carefully_, and report _how_many_spaces_ between the last digit of 
the timestamp, and the fist 'visible' character of the file name.  Check 
that count against a file name that you _can_ wild-card.  (I've got a nasty 
suspicion that there is a _space_ or other 'non-printing' character as the 
first character of the filename.) 

*IF* none of the above applies, then (and ONLY then) the following applies:
  1) try fetching the URL:
   
http://{{server}}/cv/ESIEE_MANAGEMENT/Systeme_information/11_EM2_SI_JUIN_CV_AMICHIA_Anthony%20Aim%E9e%20Marthe%20Moteh.docx

  2) NOTE:   filename 'globbing' (what you call 'wildcards') failing to match 
 that filename *is* a genuine bug as regards whatever shell you are 
 using, and you SHOULD file a formal bug report (aka PR) on that issue.

  3) For completeness, try the 'ls -lb  11*' command, while in the data 
 directory, under 'sh', 'tcsh', 'ksh', 'zsh', =and= 'bash'.  file a bug
 report for every shell where the wildcard expansion fails.

 For the bug report, Include the output generated by script(1), showing
 the 'ls -lb' of the entire directory, _and_ the attempt to use a 
 wildcard match. Do _NOT_ edit that script log file in any way.

 the ideal sequence is:
1) invoke script(1).
2) invoke the shell being tested.
3) cd(1) to the relevant directory
4) execute 'ls -lb'
5) execute 'ls -lb 11*
6) exit the shell under test.
7) exit scriot(1)
8) save the 'typescript' file under an appropriate name.

repeat for each shell tested.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-24 Thread C. P. Ghost
On Mon, May 23, 2011 at 5:50 PM, Modulok modu...@gmail.com wrote:
 Short answer, use a glob pattern. Assume I have a file named 'à fichier.txt':

(...)

Very good hints indeed.

I once had a directory full of files with strange characters, so I wrote a
little program that replaced every non-ascii char in a filename with its
hex-encoding (like this: Hello%20World%21, % escape char), so
I could manipulate them with the shell. As long as the expanded
filenames didn't hit the MAXNAMELEN limit in sys/dirent.h, it
worked perfectly.

I could dig this C program out of old archives, but I guess that it is
faster to rewrite it on the fly, or even script it with sh(1), tr(1), awk(1),
and find(1)... ;-)

Alternatively to such a run-once-in-a-while program, I could also
imagine a file system layer on top of existing file systems that
would do this conversion automatically, but that's harder to code,
and harder to debug (kernel mode!).

-cpghost.

-- 
Cordula's Web. http://www.cordula.ws/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-24 Thread Frank Bonnet


finally one of our developer has written
a php function that transcode all accentuated
characters to the corresponding non accentuated
thanks to her !!!

but the problem is NOT solved just workarrounded


Le 24/05/2011 19:53, C. P. Ghost a écrit :

On Mon, May 23, 2011 at 5:50 PM, Modulokmodu...@gmail.com  wrote:

Short answer, use a glob pattern. Assume I have a file named 'à fichier.txt':


(...)

Very good hints indeed.

I once had a directory full of files with strange characters, so I wrote a
little program that replaced every non-ascii char in a filename with its
hex-encoding (like this: Hello%20World%21, % escape char), so
I could manipulate them with the shell. As long as the expanded
filenames didn't hit the MAXNAMELEN limit insys/dirent.h, it
worked perfectly.

I could dig this C program out of old archives, but I guess that it is
faster to rewrite it on the fly, or even script it with sh(1), tr(1), awk(1),
and find(1)... ;-)

Alternatively to such a run-once-in-a-while program, I could also
imagine a file system layer on top of existing file systems that
would do this conversion automatically, but that's harder to code,
and harder to debug (kernel mode!).

-cpghost.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-24 Thread Chuck Swiger
On May 24, 2011, at 11:32 AM, Frank Bonnet wrote:
 finally one of our developer has written
 a php function that transcode all accentuated
 characters to the corresponding non accentuated
 thanks to her !!!
 
 but the problem is NOT solved just workarrounded

Sure.  FreeBSD's default filesystem supports UTF8, but not arbitrary 
composition of Unicode characters.  If you want this to work better, you need 
to make sure that you use normalized UTF8 filenames and UTF8 URLs from Apache.

It's likely that a discussion of Unicode normalization would be helpful:

  http://www.unicode.org/reports/tr15/index.html

IBM's ICU (at http://site.icu-project.org/), or Apple's discussion of HFS 
normalization (Unicode Normal Forms D, at 
http://developer.apple.com/library/mac/#qa/qa2001/qa1235.html) would also be 
informative.

Regards,
-- 
-Chuck

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-23 Thread Robert Bonomi
 From owner-freebsd-questi...@freebsd.org  Sun May 22 10:02:02 2011
 From: Frank Bonnet f.bon...@esiee.fr
 Date: Sun, 22 May 2011 17:00:48 +0200
 To: freebsd-questions@freebsd.org
 Subject: Filename containing French characters ?

 Hello

 I'm going mad trying to Open a file which the filename contains one or 
 more French characters ( file not found ) Is there some magical receipe 
 to do so ? Or do I have to forget trying ???

insufficient data for a meaningful answer..

It depends on what kind of a filesysem the file in question is located on.
It depends on how filenames are represented in that filesystem.
It depends on the drivers, or userland utilities being used to access that
filesystem.

It depends on whether or not what _you_ think the name of the file is, when
the filesystem is accessed by FreeBSD, and what the O/S thinks the filename
is.  *YOU* have to use 'what the O/S *thinks* the filename is', to succeed.

First things first, do a directory listing of the filesystem, and *see* what
FreeBSD thinks the name of the file is.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-23 Thread Robert Bonomi
 From owner-freebsd-questi...@freebsd.org  Sun May 22 23:56:05 2011
 Date: Mon, 23 May 2011 06:54:44 +0200
 From: Frank Bonnet f.bon...@esiee.fr
 To: freebsd-questions@freebsd.org
 Subject: Re: Filename containing French characters ?



 Le 22/05/2011 17:31, Mike Jeays a ecrit :
  On Sun, 22 May 2011 17:00:48 +0200 Frank Bonnetf.bon...@esiee.fr  
  wrote:
 
  Hello
 
  I'm going mad trying to Open a file which the filename contains one or 
  more French characters ( file not found ) Is there some magical 
  receipe to do so ? Or do I have to forget trying ???
 
  Thanks
 
  Envoye de mon iPhone___ 
  freebsd-questions@freebsd.org mailing list 
  http://lists.freebsd.org/mailman/listinfo/freebsd-questions To 
  unsubscribe, send any mail to 
  freebsd-questions-unsubscr...@freebsd.org
 
  If the first few characters is not accented, type 'mv ', then the 
  first few characters,  in a command line, and press 'tab' so the 
  auto-completion works. Don't forget the closing quote. Then rename it 
  to something else.

 Access right are OK ( 644 ) the completion does not work, the operating 
 system says file not found when I try to open it with any program.

 when I type the ls -l command the file is displayed with a ? in place 
 of the French (accentuated ) character

 I tried UTF8 or iso8859-1 as MM-CHARSET and fr_FR.ISO8859-1 as LANG 
 global variables but it still don-t work

 ___
 freebsd-questions@freebsd.org mailing list 
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions To 
 unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-23 Thread Robert Bonomi

 Date: Mon, 23 May 2011 06:54:44 +0200
 From: Frank Bonnet f.bon...@esiee.fr
 To: freebsd-questions@freebsd.org
 Subject: Re: Filename containing French characters ?

 Le 22/05/2011 17:31, Mike Jeays a ecrit :
  On Sun, 22 May 2011 17:00:48 +0200 Frank Bonnetf.bon...@esiee.fr  
  wrote:
 
  Hello
 
  I'm going mad trying to Open a file which the filename contains one or 
  more French characters ( file not found ) Is there some magical 
  receipe to do so ? Or do I have to forget trying ???
 
  Thanks
 
  If the first few characters is not accented, type 'mv ', then the 
  first few characters,  in a command line, and press 'tab' so the 
  auto-completion works. Don't forget the closing quote. Then rename it 
  to something else.

 Access right are OK ( 644 ) the completion does not work, the operating 
 system says file not found when I try to open it with any program.

 when I type the ls -l command the file is displayed with a ? in place 
 of the French (accentuated ) character

 I tried UTF8 or iso8859-1 as MM-CHARSET and fr_FR.ISO8859-1 as LANG 
 global variables but it still don-t work

The *easy* work-arouond -- it does -not- solve the real problem, but does
let you work with the file -- is to rename the file.

*Assuming* you are seeing the rest of the filename, _after_ the '?' character,
then issue an 'mv' command, using the source file name _exactly_ as shown
(i.e., _with_ the '?' in place of the unprintable character), and using a
destination file name that is _without_ any accented characters in it.

If that mv fails, try repeating it, but using an '*' instead of the '?'.

Oh, there is one more situation that can cause the kind of problem you are
seeing.  Does the 'ls -l' show it as an _actual_ file, or a 'symlink' (to
a file that does not exist)?  A 'dangling symlink' can give all sorts of
strange errors.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-23 Thread Matthieu Riviere
Hi,

What is the underlying filesystem ? NTFS, in particular, seems to have specific 
mount options to handle UTF-8 (and maybe other encodings) stuff. Not sure if 
they apply to your case, but it's worth trying.


Matthieu

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-23 Thread Frank Bonnet

On 05/23/2011 03:08 PM, Robert Bonomi wrote:

Date: Mon, 23 May 2011 06:54:44 +0200
From: Frank Bonnetf.bon...@esiee.fr
To: freebsd-questions@freebsd.org
Subject: Re: Filename containing French characters ?

Le 22/05/2011 17:31, Mike Jeays a ecrit :

On Sun, 22 May 2011 17:00:48 +0200 Frank Bonnetf.bon...@esiee.fr
wrote:


Hello

I'm going mad trying to Open a file which the filename contains one or
more French characters ( file not found ) Is there some magical
receipe to do so ? Or do I have to forget trying ???

Thanks

If the first few characters is not accented, type 'mv ', then the
first few characters,  in a command line, and press 'tab' so the
auto-completion works. Don't forget the closing quote. Then rename it
to something else.

Access right are OK ( 644 ) the completion does not work, the operating
system says file not found when I try to open it with any program.

when I type the ls -l command the file is displayed with a ? in place
of the French (accentuated ) character

I tried UTF8 or iso8859-1 as MM-CHARSET and fr_FR.ISO8859-1 as LANG
global variables but it still don-t work

The *easy* work-arouond -- it does -not- solve the real problem, but does
let you work with the file -- is to rename the file.


Not easy the file is created by a software that extract it from a SQL 
database

*Assuming* you are seeing the rest of the filename, _after_ the '?' character,
then issue an 'mv' command, using the source file name _exactly_ as shown
(i.e., _with_ the '?' in place of the unprintable character), and using a
destination file name that is _without_ any accented characters in it.

If that mv fails, try repeating it, but using an '*' instead of the '?'.

Oh, there is one more situation that can cause the kind of problem you are
seeing.  Does the 'ls -l' show it as an _actual_ file, or a 'symlink' (to
a file that does not exist)?  A 'dangling symlink' can give all sorts of
strange errors.


no it is not a symlink it's a real file


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-23 Thread Frank Bonnet

On 05/23/2011 03:46 PM, Matthieu Riviere wrote:

Hi,

What is the underlying filesystem ? NTFS, in particular, seems to have specific 
mount options to handle UTF-8 (and maybe other encodings) stuff. Not sure if 
they apply to your case, but it's worth trying.


Matthieu



the volume is NFS mounted ( to a netapp filer )

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-23 Thread Polytropon
On Mon, 23 May 2011 06:54:44 +0200, Frank Bonnet f.bon...@esiee.fr wrote:
 when I type the ls -l command the file is displayed
 with a ? in place of the French (accentuated ) character

That's typical for console operations (text mode) when
UTF-coded characters are encountered. The text mode console
does not support UTF-8 and does display ? whenever it
encounters a nonprintable character.




 I tried UTF8 or iso8859-1 as MM-CHARSET and fr_FR.ISO8859-1 as LANG
 global variables but it still don-t work

Depending on what actual file system the file is located,
you may need to define a translation mode (e. g. -C or -W
in combination with mount_ntfs).

You also have to make sure that if you change language
settings, your console has to support it.

As a german user, I can use german Umlauts and Eszett
with the text mode console as I don't use UTF nonsense
for that.

For example, I have

ttyv0  /usr/libexec/getty Pc  cons25l1  on  secure
up to

ttyv7  /usr/libexec/getty Pc  cons25l1  on  secure

in /etc/ttys.

For language settings, please see that FreeBSD does, next
to $LANG, also use $LC_* variables. To use language-specific
characters when running programs (less, mcedit, vi, anything
that inputs or outputs file data), the following settings
are made in /etc/csh.cshrc (my default shell, system-wide
settings):

setenv  LC_ALL  en_US.ISO8859-1
setenv  LC_MESSAGES en_US.ISO8859-1
setenv  LC_COLLATE  de_DE.ISO8859-1
setenv  LC_CTYPEde_DE.ISO8859-1
setenv  LC_MONETARY de_DE.ISO8859-1
setenv  LC_NUMERIC  de_DE.ISO8859-1
setenv  LC_TIME de_DE.ISO8859-1

This makes program messages being in English (preferred),
but sets some conventions specific to Germany.

I'm sure you can do something similar with the correct
language settings and pages for French. It also works
with Unicode when using programs that are capable of
employing UTF-8 with setenv LANG de_DE.UTF-8. In this
case, even chinese characters can be used, given the
proper fonts.

Still, I may emphasize that it's NOT good to have non-ASCII
characters in file names. Things like spaces, quotes,
backslashes, et, curly braces and other special characters
_are_ possible in file names, but they do not belong there.
On the systems I had to maintain, I adviced my children...
erm... users! :-) to only use lowercase letters and _ instead
of space, combined with a corporate-given naming convention
for work files that had to be managed by the users.

A solution (that does solve the problem, not its cause)
would be to install the Midnight Commander and use it in
a UTF-8 capable terminal in X (but also works in text
mode), move the cursor to a file and press PF6 (rename),
then enter a name in ASCII. Using this approach, you don't
have to enter the original file name .???. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-23 Thread Modulok
Short answer, use a glob pattern. Assume I have a file named 'à fichier.txt':

ls -l
-rw-r--r--  1 Modulok  Modulok   12 May 23 09:01 ?? fichier.txt

mv ?\ fichier.txt aFile.txt

Long answer, for those who want to follow along and fix their terminal to
display UTF-8, keep reading...

Step 1: Make a funky file to play along with this min-tutorial:
===

Create a text file with an editor that supports non-ASCII characters. I
created a file named 'filename' which containing this (no newline!):

à fichier.txt

Step 2: Create the actual file with content
===

I used echo and cat like so in the tcsh shell:

echo hello world  `cat filename`


Step 3: Show the file in ls
===

As you can see below, the first character of the filename is displayed as two
question marks. This is the terminal's way of showing filenames that it cannot
display correctly. There are two question marks, because this is a two-byte
character. This does *not* mean the filename starts with a literal question
mark:


-rw-r--r--  1 Modulok  Modulok   12 May 23 09:01 ?? fichier.txt

Step 4: (optional) Fix the terminal
===

At this point, let's just fix the terminal so that UTF-8 characters are
displayed correctly. We want to see the French accented 'à', and not a bunch of
question marks. To do this, you edit '/etc/login.conf' as root. Add two lines
at the bottom of the 'default' section. My default section now looks like this:


default:\
:passwd_format=md5:\
:copyright=/etc/COPYRIGHT:\

...and so on...

:charset=en_US.UTF-8:\
:lang=en_US.UTF-8:

If you're a French operation yours should probably look like this instead:

default:\
:passwd_format=md5:\
:copyright=/etc/COPYRIGHT:\

...and so on...

:charset=fr_FR.UTF-8:\
:lang=fr_FR.UTF-8:

I'm not certain on these for all countries, but the above examples work. We
then need to rebuild the actual login database. Execute the following command
as root:

cap_mkdb /etc/login.conf

This generates /etc/login.conf.db from /etc/login.conf. Now log out and then
back in!


Step 5: Back to the funky file
==

You should now see the actual accent characters correctly in the terminal.
(Assuming your terminal supports this):

-rw-r--r--  1 Modulok  Modulok   12 May 23 09:01 à fichier.txt

In some ternimals, we cannot type these characters. So you can access the
filename through a shell glob pattern. In most shells, the glob pattern '?'
matches any single character. The forward slash escapes the space in the
filename.

mv ?\ fichier.txt aFile.txt


Hope this helps (and doesn't get too mangled.)
-Modulok-
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-23 Thread Frank Bonnet

Thanks that is working :-)

Now I have to test the application ( apache based application )
to see if it is able to open the file.

I'll tell in few hours when arrived to my office


Le 23/05/2011 17:50, Modulok a écrit :

Short answer, use a glob pattern. Assume I have a file named 'à fichier.txt':

 ls -l
 -rw-r--r--  1 Modulok  Modulok   12 May 23 09:01 ?? fichier.txt

 mv ?\ fichier.txt aFile.txt

Long answer, for those who want to follow along and fix their terminal to
display UTF-8, keep reading...

Step 1: Make a funky file to play along with this min-tutorial:
===

Create a text file with an editor that supports non-ASCII characters. I
created a file named 'filename' which containing this (no newline!):

 à fichier.txt

Step 2: Create the actual file with content
===

I used echo and cat like so in the tcsh shell:

 echo hello world  `cat filename`


Step 3: Show the file in ls
===

As you can see below, the first character of the filename is displayed as two
question marks. This is the terminal's way of showing filenames that it cannot
display correctly. There are two question marks, because this is a two-byte
character. This does *not* mean the filename starts with a literal question
mark:


 -rw-r--r--  1 Modulok  Modulok   12 May 23 09:01 ?? fichier.txt

Step 4: (optional) Fix the terminal
===

At this point, let's just fix the terminal so that UTF-8 characters are
displayed correctly. We want to see the French accented 'à', and not a bunch of
question marks. To do this, you edit '/etc/login.conf' as root. Add two lines
at the bottom of the 'default' section. My default section now looks like this:


 default:\
 :passwd_format=md5:\
 :copyright=/etc/COPYRIGHT:\

 ...and so on...

 :charset=en_US.UTF-8:\
 :lang=en_US.UTF-8:

If you're a French operation yours should probably look like this instead:

 default:\
 :passwd_format=md5:\
 :copyright=/etc/COPYRIGHT:\

 ...and so on...

 :charset=fr_FR.UTF-8:\
 :lang=fr_FR.UTF-8:

I'm not certain on these for all countries, but the above examples work. We
then need to rebuild the actual login database. Execute the following command
as root:

 cap_mkdb /etc/login.conf

This generates /etc/login.conf.db from /etc/login.conf. Now log out and then
back in!


Step 5: Back to the funky file
==

You should now see the actual accent characters correctly in the terminal.
(Assuming your terminal supports this):

 -rw-r--r--  1 Modulok  Modulok   12 May 23 09:01 à fichier.txt

In some ternimals, we cannot type these characters. So you can access the
filename through a shell glob pattern. In most shells, the glob pattern '?'
matches any single character. The forward slash escapes the space in the
filename.

 mv ?\ fichier.txt aFile.txt


Hope this helps (and doesn't get too mangled.)
-Modulok-

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-22 Thread Eitan Adler

 I'm going mad trying to
 Open a file which the filename contains one or more French characters ( file 
 not found )
 Is there some magical receipe to do so ? Or do I have to forget trying ???

Open a file using what program? Do you have permission to read/write
to the file? What is the file called?
You need to give us more data to help you.


-- 
Eitan Adler
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-22 Thread Mike Jeays
On Sun, 22 May 2011 17:00:48 +0200
Frank Bonnet f.bon...@esiee.fr wrote:

 Hello
 
 I'm going mad trying to
 Open a file which the filename contains one or more French characters ( file 
 not found )
 Is there some magical receipe to do so ? Or do I have to forget trying ???
 
 Thanks
 
 Envoyé de mon iPhone___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

If the first few characters is not accented, type 'mv ', then the first few 
characters,  in a command line, and press 'tab' so the auto-completion works. 
Don't forget the closing quote. Then rename it to something else.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Filename containing French characters ?

2011-05-22 Thread Frank Bonnet



Le 22/05/2011 17:31, Mike Jeays a écrit :

On Sun, 22 May 2011 17:00:48 +0200
Frank Bonnetf.bon...@esiee.fr  wrote:


Hello

I'm going mad trying to
Open a file which the filename contains one or more French characters ( file 
not found )
Is there some magical receipe to do so ? Or do I have to forget trying ???

Thanks

Envoyé de mon iPhone___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


If the first few characters is not accented, type 'mv ', then the first few 
characters,  in a command line, and press 'tab' so the auto-completion works. Don't 
forget the closing quote. Then rename it to something else.


Access right are OK ( 644 )
the completion does not work, the operating system says file not found
when I try to open it with any program.

when I type the ls -l command the file is displayed
with a ? in place of the French (accentuated ) character

I tried UTF8 or iso8859-1 as MM-CHARSET and fr_FR.ISO8859-1 as LANG
global variables but it still don-t work

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org