Better "disp" value for \n or \r content

Issue #19 new
Chase Tingley created an issue

See also Okapi issue 626, which is the same issue for XLIFF 1.2.

Attached are a sample XML file and ITS rules to extract codes for the text \n and \r. However, when extended code attributes are used, the disp value for these codes is a literal newline/carriage return.

Some users may prefer an alternate (visible) representation of these characters. (<n> / <r> has been suggested, but I don't know if there are other commonly-used conventions.)

Comments (3)

  1. ysavourel

    So, just to be sure I get this right: We want the library to automatically change a string from "Line1\nLine2\r" to "Line1\\nLine2\\r" when such text is set in disp? Or maybe, to be more flexible, have a way to define replacement strings for \n and \r (and possibly \n\r) and use them when setting disp?

    What should be the default? No replacement? \\n and \\r? <n> and <r>?

  2. Kuro Kurosaka

    I think the default should be the way it is done in the current code, spitting out the literal newlines or whatever the system's EOL is.

    As far as options go, one option would be the C/Java style "\n", "\r", etc. and another would be the numeric entities (" " etc.) since this appears in the XML file. I'm not sure if we should introduce our own way <n>, unless this is a popularly method in areas I am not aware of.

  3. Log in to comment