Closed Bug 1014672 Opened 11 years ago Closed 11 years ago

& character translated to &

Categories

(Firefox :: Translations, defect)

32 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 32

People

(Reporter: Kensie, Assigned: Felipe)

References

()

Details

(Whiteboard: p=1 s=it-32c-31a-30b.3 [qa-])

Attachments

(3 files)

http://www.mercotte.fr/recettes/macarons/ Translating from fr to en, & character translated to & See attachments for images.
Original french.
Translated to english
Flags: firefox-backlog+
I believe Felipe actually mentioned this yesterday on IRC!
Yep, that's the one. This is a bug in Bing's service, that happens only for the plain-text strings that we send to it which contains &. It doesn't happen for the text/html strings sent. I tried Mike's suggestion to replace & with & instead of & but that didn't work :( However, it revealed some very interesting tidbit. Even if I send using the hex version, like: "Gâteaux & Entremets" what we get back from the service is...: "Cakes & desserts" So it's clearly an internal bug in their output encoding. We will need to have a workaround. Some options: 1 - Do not send as plain-text strings that we've checked that contain & 2 - For plain-text strings, do not encode & and carefully verify that it won't cause invalid XML to be sent 3 - Experiment sending the string wrapped in a CDATA section 4 - Assume that the bug will happen, and unescape & to & on the string received All options are kinda awful, but I'm leaning towards #4 which is certainly the simpler and safer of them.
This looks like a blocker bug for the Bing devs. Meanwhile, there *is* a fifth option to work around this: 5. Un-escape escaped entities with a (simple) regex; so `&` would become `&` and `>gt;` --> > `.replace(/&(#[0-9]{1,3}|[a-zA-Z]+);(:?#[0-9]{1,3}|[a-zA-Z]+);/, "&$1;");`
Attached patch trAmpersandSplinter Review
Yeah, though I've checked that this only happens with the & char, and it doesn't happen with < and > etc.. So I think we can go that way but with a simpler solution instead of a more comprehensive regexp.
Assignee: nobody → felipc
Status: NEW → ASSIGNED
Attachment #8434689 - Flags: review?(mdeboer)
Comment on attachment 8434689 [details] [diff] [review] trAmpersand This looks 'good' to me ;) Do we have a way to file this bug for the Bing devs? Or did we already do that?
Attachment #8434689 - Flags: review?(mdeboer) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/a010a557a1b5 They have support forums, I'll try posting it there
Marco, can you add this bug to the current iteration?
Flags: needinfo?(mmucci)
Whiteboard: p=1 [qa-]
Added to Iteration 32.3
Flags: needinfo?(mmucci)
Whiteboard: p=1 [qa-] → p=1 s=it-32c-31a-30b.3 [qa-]
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 32
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: