Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-30-2008, 07:29 PM   #1
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 576

Rep: Reputation: 38
Filenames with accented characters and XFS

I have a question about accessing files, where the filename contains accented characters on an XFS formatted mount.

I have a filesystem, formatted with XFS, that resides in a logical volume, if that makes any difference. That filesystem is also exposed to Windows XP, via Samaba.

From a Windows application, I create files, which may contain accented characters in the filename, together with a text file containing a list of the files created.

On the Linux side, I have an application that reads the text file, and then tries to open the files. This is failing on the files with the accented characters.

If I cat, vi, or KEdit the text file, I see the correct accented characters. However, if I ls the files, I get 2 "other" characters per accent character.

My application fails to open the file, and the error message I produce shows the file name with the accented characters.

Why does ls show the "multiple" characters that make up the accented character, and how do I get my application to open the file.

Old 07-31-2008, 06:13 AM   #2
Registered: Jun 2008
Location: Phoenix, Arizona, USA
Distribution: Slackware
Posts: 328

Rep: Reputation: 51
Your machine is not totally localized is my guess. You'll need look at the man pages and other docs to see how to get "ls" and those other programs to understand your file names (and maybe other things) aren't in English. In particular with the filenames, you may need alternate language support in the file system, but I don't know if XFS supports that. The options show up in the kernel compile menu when compiling M$ or ISO-9660 (CD-ROM) filesystems, and XFS may support them too, but I've never used it so I don't know. I just remembered, they're called "code pages".

Old 07-31-2008, 06:28 PM   #3
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 576

Original Poster
Rep: Reputation: 38
It looks like XFS is UTF-8 "aware" by default, and stores the file names as multi-byte, for the accented characters.

My system is NOT UTF-8 aware, which is why when I ls the files, I see 2 characters for each accented one. I can see the correct accented characters in the text file, because they have been stored as "extended ASCII", in the 128-255 range, not as UTF-8.

What I have to do, is convert the single-byte "extended ASCII" to multi-byte UTF-8, then it all works. At least for loading the files. I don't care about being able to see the correct file name, which I know I can fix, by making my system UTF-8 aware. Although, if I do that, I think I'd have trouble distinguishing between the "extended ASCII" and UTF-8 versions of the same character, as they'd both show exactly the same.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Garbled fonts (accented) in filenames from Windows Jykke Linux - Desktop 1 12-29-2007 04:11 AM
Typing accented characters in Linux VicRic Linux - Newbie 3 05-21-2007 02:41 PM
no accented characters on an old olivetti laptone plbrt Linux - Software 0 08-10-2006 03:48 PM
Quanta accented characters spaniard Linux - Software 4 11-04-2005 01:08 AM
Accented characters in C Orkie Programming 2 05-17-2005 01:50 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:20 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration