choopau
choopau

Reputation: 2387

Is there anyway I can escape ' without affecting the whole html in azure cognitive service translation?

LANGUAGE #1

'<div><span style="">Santé méritétaine,</span> Sam’s Club.</div>'

LANGUAGE #2

'<div><span style=\"\">Meritain Salud,</span> Sam's Club.</div>'

Using azure cognitive service, I've translated two htmls. Above are their results.

The first one got no error because the ’ doesn't cuts the string in the word Sam’s.

I got problem in the second one because ' used is the same with the string syntax. It becomes ''' .

Escaping ' character means replacing ' to '' characters. Also, it might not good to use replace extension because the whole html might be affected.

is there anyway I can escape ' without affecting the whole html?

Upvotes: 0

Views: 82

Answers (1)

Ramprasad
Ramprasad

Reputation: 132

Some possible methods are:

Doubling the single quote characters, e.g., ’ becomes ‘’.

Using a backslash to escape the single quote, e.g., ’ becomes '.

Replacing the single quote with an HTML entity.

Upvotes: 0

Related Questions