Live data from Hacker News

ASCII and Unicode quotation marks

cl.cam.ac.uk

151–160 of 195 posts

Re: ASCII and Unicode quotation marks

#151
post #33

Earlier quoted context omitted.

Yes. I consider it a mistake of Unicode that combining characters follow rather than precede the base character. If they preceded, most dead keys could simply generate the appropriate combining character, rather than requiring complicated input method support. (And finding the end of a sequence of multiple combining character wouldn't require lookahead.)

The Unicode way makes sorting easier. Your way would require special knowledge about the characters to know that ä should sort directly after a, rather than directly before ë.

Except not really, since in Swedish, it's sorted xyzåäö, not aåäbc. Also, it used to be that w and v were equivalent sorting-wise and you'd mix them together.

Re: ASCII and Unicode quotation marks

#152
It seems that half of the people in this company use the wrong acute sign `as an apostrophe instead of ' or ’. Unfortunately it's the half that creates presentations and talks to customers.

It looks terrible and to me it's a disgrace!

Example: it`s versus it's or it’s. (first one is wrong).

Re: ASCII and Unicode quotation marks

#153
post #48

Earlier quoted context omitted.

The complexity might be minimized, but not avoided. You would still need an escape mechanism for something like «She said «The \» key on the server doesn't work.»» ASCII did add , [], and {}, any of which could have been used for quoted strings, had the programming language designers chosen that option. https://en.wikipedia.org/wiki/String_literal#Paired_delimite... points out that PostScript and Tcl have a string li…

Ruby lets you use arbitrary tokens for string literals with %s{} (where the braces can be a bunch of things). I wish more languages would adopt this tbh.

Ruby lifted that from Perl.

  say qq;

Re: ASCII and Unicode quotation marks

#155
post #58

Earlier quoted context omitted.

You don’t need escaping in «This is a string containing an «embedded» quoted string».

Debatable whether that would actually work in practice. /* nested /* comments */ don't work */

This is possible in D using /+ comments +/.

https://wiki.dlang.org/Commenting_out_code#Nested_comments

This allows commenting out code containing comments, which can be useful when debugging or giving usage examples in the code.

Re: ASCII and Unicode quotation marks

#156

Earlier quoted context omitted.

It's useful to tell a text editor "This is UTF-8, not Windows-1252 or ISO-8859-1 or whatever you might be used to".

No, just do 8-bit clean, don't SCREW with the encoding if you weren't asked to.

An editor can't "just do 8-bit clean", it has to display the characters. The same bytes will sometimes be displayed differently in utf-8 and (e.g.) ISO-8859-1.

I'm not sure if a BOM is a good way to handle it, but saying 'just do 8-bit clean' doesn't work when you're displaying or printing the characters for humans to understand.

Re: ASCII and Unicode quotation marks

#157

I hate the "" -> “” thing with a passion. I don't know how much productivity that the world has lost with that “” shit. It doesn't look that much better, and it always fucks with me at random times. That shit is on the list of annoying problems that shouldn't exist in the first place, along with the \nl\cr thing, and the txt saved as rtf thing, and the UTF-8 encoding-character-at-the-beginning-of-the-file or whatever…

[deleted]

Re: ASCII and Unicode quotation marks

#158

I hate the "" -> “” thing with a passion. I don't know how much productivity that the world has lost with that “” shit. It doesn't look that much better, and it always fucks with me at random times. That shit is on the list of annoying problems that shouldn't exist in the first place, along with the \nl\cr thing, and the txt saved as rtf thing, and the UTF-8 encoding-character-at-the-beginning-of-the-file or whatever…

Must not be a fan of typography then. Sadly, the tech world is full of the likes of you, so even if people care, in many cases—such as dashes—they are not even aware of the alternatives. Gladly Apple has decided not to follow your ““““opinion”””” by default.

Re: ASCII and Unicode quotation marks

#159
post #79

Earlier quoted context omitted.

There is actually an ASCII character that doesn't appear in strings, and is meant to be used as such a separator. Actually two of them, record (30) and unit separator (31).

Sadly, eventually someone will want to enter one document as a field in another document and then you end up needing escaping anyways. Using a rare symbol for the delimiter would still be nice for typing documents by hand, but it would have to be available on modern keyboards to be convenient.

>Sadly, eventually someone will want to enter one document as a field in another document and then you end up needing escaping anyways.

Yes, but CSV files are record collections, they are not in 99% of cases recursive like that.

If a column contains escaped secondary documents, there's something wrong.

Re: ASCII and Unicode quotation marks

#160

Earlier quoted context omitted.

I've been trying to push TSV (tab separated values) as a standard response/implementation when they ask for CSV. "Yes but its comma separated!", sure is, but text can contain commas... I have seen issues with Google Spreadsheets not recognizing the tabs however... Excel doesnt know what to do with a TSV either. But both have a complete wizard for parsing CSV...

Excel will convert any tabulated text file into a spreadsheet regardless of the delimiters, or even lack of, as you can set which character(s) to delimit by or even just go by column numbers for tables of fixed widths. This is actually one of the few things Excel gets right with regards to CSV files as I've found it a horrid tool if you need to save any changes and preserve the original formatting of the CSV file (ev…

Your CSV would actually look like this instead:

    full name,address
    Homer Simpson,"742 Evergreen Terrace,
    Springfield"
    "Bart ""El Barto"" Simpson","742 Evergreen Terrace,
    Springfield"
(Omitted optional quotes for fields that don't need them). Quotes are escaped with "", and line breaks don't need escaping, they just have to be in a quoted field. And there is no space after a comma, except you want that space to be part of the field's value.
Post reply on HN