tags:

views:

175

answers:

2

Well i have implemented my own NFS server and everything is working good but how do i encode chars that arent part of the ASCII standard? the XDR RFC says that strings are encoded as ascii that would then remove all non ascii chars? but if i start up a nfs server that i havent written it seems to have support for those chars...

Iv tryed creating a folder named "hej åäö" and it displays correctly on the nfs client, if i look at the data sent with WireShark, i get the string "hej \345\344\366" or in hex "68656a20e5e4f6" what encoding is this?

Also try ed to encode "hej 1 + 1 = 2"..

Try ed UTF-7 worked great with åäö but not with + so its not UTF-7

+1  A: 

The codeset looks like ISO 8859-1 or 8859-15 (can't tell which since the shown symbols are common to both).

  • å = 0xE5 = 0345
  • ä = 0xE4 = 0344
  • ö = 0xF6 = 0366

The spec is probably outdated and you just need to transmit characters with the high-order (8th) bit set - just like the other NFS server does.


Distinguishing ISO 8859-1 and 8859-15

The differences between the two code sets - with their Unicode charaacter mappings - is shown in this output (derived from a diff between files defining the Unicode equivalents of characters in 8859-1 and 8859-15).

ISO 8859-1

  • A4 U+00A4 CURRENCY SIGN
  • A6 U+00A6 BROKEN BAR
  • A8 U+00A8 DIAERESIS
  • B4 U+00B4 ACUTE ACCENT
  • B8 U+00B8 CEDILLA
  • BC U+00BC VULGAR FRACTION ONE QUARTER
  • BD U+00BD VULGAR FRACTION ONE HALF
  • BE U+00BE VULGAR FRACTION THREE QUARTERS

ISO 8859-15

  • A4 U+20AC EURO SIGN
  • A6 U+0160 LATIN CAPITAL LETTER S WITH CARON
  • A8 U+0161 LATIN SMALL LETTER S WITH CARON
  • B4 U+017D LATIN CAPITAL LETTER Z WITH CARON
  • B8 U+017E LATIN SMALL LETTER Z WITH CARON
  • BC U+0152 LATIN CAPITAL LIGATURE OE
  • BD U+0153 LATIN SMALL LIGATURE OE
  • BE U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS
Jonathan Leffler
is there some char i could name my folder to so i can tell if its ISO 8859-1 or 8859-15?
Petoj
it seems it uses 8859-1 thanks!
Petoj
A: 

If I recall, the NFS server treats encoding really badly.

No byte of any character in a filename may be 0 or 0x2F and the maximum length is 255 bytes.

Hence the popularity of UTF-8 encoded filenames.

Joshua