Talk:Unix2dos

Latest comment: 3 years ago by Robin A. Meade in topic tr -d '\r' is too utf-8 safe

Does this command handle byte order mark?

edit

As windows standard is to use byte order mark, and unix standard might be to not use byte order mark to use autodetection, does this command handle byte order mark the appropriate way? — Preceding unsigned comment added by 84.99.16.252 (talk) 21:35, 30 June 2012 (UTC)Reply

tr -d '\r' is too utf-8 safe

edit

Regarding:

tr -d '\r' < file > file2 # For ASCII and other files which do not contain multibyte characters (Not utf-8 safe).

That tr command is utf-8 safe. See UTF-8:

"ASCII bytes do not occur when encoding non-ASCII code points into UTF-8"

It is not UTF-16 safe because UTF-16 is incompatible with ASCII, although I've read that tr on MacOS can handle unicode character sets depending on the value of LC_CTYPE. Robin A. Meade (talk) 20:01, 1 June 2021 (UTC)Reply