Exporting localisations does not escape quotation marks and new lines correctly

Originator:liam-nichols
Number:rdar://41777896 Date Originated:03/07/2018
Status:New Resolved:No
Product:Developer Tools Product Version:Version 10.0 beta 2 (10L177m)
Classification:Serious Bug Reproducible:Always
 
Summary:
The Xcode Export Localisation tool fails to correctly escape quotation marks and new line sequences when exporting via "Editor -> Export For Localization..." or via the xcodebuild command line tool. 

The behaviour changed in Xcode 9.3 and has been broken ever since. I've included the "_SampleExport" folder that shows the results of the export when I run it on my machine. Xcode 9.2 produces the results as expected.

The result of this corrupt export means that many third party translation tools retain the escapes in the translated xliff files but when importing them via the import tool, it will corrupt the .strings files as the escaping is wrong. I have not covered an example of it in this report as I believe it will be fixed once the export issue is fixed however it is still worth noting.

Steps to Reproduce:
1. Download the attached sample project
2. Open the project in Xcode 10 (Beta 2)
3. Click on the project in the Project Navigator
4. Click on "Editor" in the menu bar
5. Click on "Export For Localization..." 
6. Export the development language somewhere and open the exported xliff file in a text editor

Expected Results:
- Quotation marks that had been escaped with a backslash in order to comply with the open step plist format are not included inside the source tag of a translation unit.
- New line escapes (\n) that had been added in the .strings file should be converted into an actual new line within the source tag in the translation unit.

Actual Results:
- The backslash escaping the quotation marks still remain in the xliff file.
- The new line escape remains as "\n" in the xliff file

Version/Build:
Version 10.0 beta 2 (10L177m)

Configuration:
N/A

Comments

Resolved In Xcode 10 Beta 5, verified by me

By liam-nichols at Aug. 2, 2018, 12:06 p.m. (reply...)

DUPLICATE OF rdar://41252283 | OPEN

By liam-nichols at Aug. 2, 2018, 11:32 a.m. (reply...)

Engineering has determined that your bug report is a duplicate of another issue and will be closed.

By liam-nichols at Aug. 2, 2018, 11:32 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!