We help IT Professionals succeed at work.

compare plain html text

johnkainn
johnkainn asked
on
In a table I have text that sometimes is html, for example "ö" becomes "ö"
I need to compare this with plain text. How can I do that?
Comment
Watch Question

anarki_jimbelSenior Developer
CERTIFIED EXPERT

Commented:
Could you please tell more about your task?

Do you need an external tool to compare? Or you want to to do that in your code pro grammatically?
Examples?
What outcome you want from your examples?
anarki_jimbelSenior Developer
CERTIFIED EXPERT

Commented:

Author

Commented:
I was hoping to do this in sql.

Commented:
>>I was hoping to do this in sql.<<

That can by making a CLR-function of the codeproject-compare with the things you need.

Pure T-sql you can use replace for all characters you think necessary .... and after gone trough the 'htmlchar-replacer' you can compare the strings.

replace(htmlString, 'ö', '&ouml;')
or the other way
replace(htmlString, '&ouml;', 'ö')
anarki_jimbelSenior Developer
CERTIFIED EXPERT
Commented:
>>I was hoping to do this in sql.<<

You may try to do as in the previous post but I believe it is not reliable way.
And it would be nice if you put your requirements upfront...
Commented:
I agree this is not something where T-sql is made for ... that's why I suggested to look at linked sollution and when necessary implement it as CLR

Explore More ContentExplore courses, solutions, and other research materials related to this topic.