hugg95 / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

goog.crypt.stringToUtf8ByteArray changes line-endings in strings! #627

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

goog.crypt.stringToUtf8ByteArray('A\r\n')
Expected: [65,13,10]
Actual: [65, 10]

For some reason, the code contains "str = str.replace(/\r\n/g, '\n');" which 
seems highly suspicious for a generic function like this.  Why would this 
method do line ending normalization?  That makes it useless to me.

Original issue reported on code.google.com by mich...@firebase.com on 4 Feb 2014 at 12:22