[Tutor] close, but no cigar

eryksun eryksun at gmail.com
Tue Jul 23 14:01:46 CEST 2013


On Tue, Jul 23, 2013 at 3:30 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> But if you include non-ASCII characters, your text editor has to convert
> them to bytes. How does it do so? Nearly every editor is different, a plain
> text file doesn't have any way of storing metadata such as the encoding.
> Contrast this to things like JPEG files, which can store metadata like the
> camera you used to take the photo.

File systems can be sneaky about this. NTFS has alternate data
streams, which were added for compatibility with Mac resource forks.

    C:\>echo some text > test.txt
    C:\>echo 1252 > test.txt:encoding

    C:\>more test.txt
    some text
    C:\>more < test.txt:encoding
    1252


More information about the Tutor mailing list