News for hackers. Stuff that matters.
Re:Hints for writing Unix tools by deathanatos on Monday October 20, 2014 @11:51PM (#8485827)
> That seems like an extremely pathological case.

When a human is creating files by hand, I almost certainly agree. When a program is creating files, however, it's only a matter of time before weird characters wind their way in there.

I really wish newlines had been disallowed. (There's UI implications, in addition to the parsing ones — how do you do a list view with newlines in the filename?; I also wish filenames had a reliable character set and weren't just bytes.)

Re:Hints for writing Unix tools by bmn_ on Tuesday October 21, 2014 @07:55AM (#8486880)
I think dwheeler is trying to get this fixed/standardised in POSIX via the Open group.
Re:Hints for writing Unix tools by oblio on Tuesday October 21, 2014 @10:57AM (#8487654)
That it's going to be an uphill battle is an understatement.

Someone replied on LWN, when he posted his proposal, that he had implemented a sort of home-grown database using non-UTF8 characters for the file names.

Rube Goldberg, indeed!

Re:Hints for writing Unix tools by userbinator on Tuesday October 21, 2014 @05:02PM (#8489983)
how do you do a list view with newlines in the filename?

Show them with the standard escape sequence for a newline:

    This\ filename\ncontains\ a\ newline
Same for any other characters that could be considered 'special' in output; I really wish the backslash convention for escaping was more common. Character sets and such are a UI/display issue, so I don't think there should be any special handling for them at the lower levels of the system.
Re:Hints for writing Unix tools by mjevans on Tuesday October 21, 2014 @05:30AM (#8486603)
UI issues; on display format all /printing display elements/ (including spaces as spaces and things that look like whitespace but aren't spaces) with readable glyphs, or those numeric standins for non-rendering glyphs.