Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:
I don’t understand how to set my configuration to be able to use
accentuated characters in filenames.
Well, the problem is that a filename does not really consist of
“characters”. It’s just a string of bytes. What characters those bytes
represent – or even whether that represent any characters at all –
depends on how you have entered them and how you try to display them.
The QNX6 text-mode console and pterm use the ISO 8859-1 character set.
When you type ‘é’, a read() from the terminal returns the byte 0xE9.
When you run “touch démarrage” in a pterm, the argv[1] that the shell
gives to the touch program is equivalent to the C string “d\xE9marrage”.
The old QNX4 terminal emulation (“pterm -Q”) uses the IBM PC character
set (a.k.a. code page 437). The ‘é’ has the value 0x82 in this
character set, and typing “touch démarrage” gives the string
“d\x82marrage” to the touch utility.
Photon uses UTF-8. If you enter “démarrage” into a text field, the
string in the widget will be “d\C3\A9marrage”.
Initially I wanted to see through Samba a FAT32 mounted filesystem. As I
wasn’t able to see filenames like ‘Démarrage’, I made some try on QNX,
and I encountered some strange behaviours.
-In bash, it’s impossible to input such characters.
Yeah, bash doesn’t seem to like them…
-In sh, I can ‘touch démarrage’ (well displayed) but ‘é’ isn’t displayed
in pfm.
That’s because “d\xE9marrage” is not valid UTF-8. I don’t know what
exactly our pfm or the file selector widget do when a filename turns out
not to be valid UTF-8; apparently, it’s not working…
-In Photon, I can create a ‘démarrage’ filename (well displayed) but ‘é’
isn’t displayed correctly in sh.
-Through Samba (2.2.4 - client character set = 850 as for our NT
stations) none of the both files is correctly displayed.
I know very little about Samba, but I think code page 850 has the ‘é’ in
the same spot as code page 437. Perhaps your filenames will look the
same way they do under Windows when you display (or enter) them in a
pterm running the QNX4 emulation (“pterm -Q”).