Unicode characters while copying text from Word in RadEditor while exporting to RTF

1 Answer 16 Views
Editor
Sushma
Top achievements
Rank 1
Sushma asked on 25 Aug 2021, 01:15 PM | edited on 26 Aug 2021, 05:20 AM

Hi Team,

We are using RadEditor in our MVC application. Content entered or copied is converted to RTF format and then saved to database.

But when we copy text like following from Microsoft word:- Text  for “Unicode ‘Testing’ Test” (text containing quotes entered in MS word) ,       after exporting to RTF, it is converting to Unicode characters as following :-    \u8220?UniCode \u8216?Testing\u8217? Test\u8221.

 

Even when we disable the filter of ConvertCharactersToEntitiesas shown below, still it is not working.

RadEditor1.DisableFilter(Telerik.Web.UI.EditorFilters.ConvertCharactersToEntities));

Instead of replacing the above characters by hardcoding them, is there any possible way to avoid this Unicode conversion. Please let us know if it is possible.


Thanks in Advance,

Sushma Katneni

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 30 Aug 2021, 02:05 PM

Hi Sushma,

The pasting is not controlled by RadEditor as explained in https://docs.telerik.com/devtools/aspnet-ajax/controls/editor/managing-content/pasting-content/overview#radeditor-and-the-browser-clipboard and these character come from the clipboard.

Here is the list of the characters which are converted by RadEditor and as you can see the ones you provided are not in the list:

	var entitiesCollection = {
		'euro': '\u20ac', 'cent': '\u00a2', 'pound': '\u00a3', 'yen': '\u00a5', 'sect': '\u00a7', 'copy': '\u00a9', 'reg': '\u00ae', 'plusmn': '\u00b1', 'ne': '\u2260',
		'asymp': '\u2248', 'le': '\u2264', 'ge': '\u2265', 'divide': '\u00f7', 'times': '\u00d7', 'iexcl': '\u00a1', 'curren': '\u00a4', 'brvbar': '\u00a6', 'uml': '\u00a8',
		'ordf': '\u00aa', 'trade': '\u2122', 'larr': '\u2190', 'uarr': '\u2191', 'rarr': '\u2192', 'darr': '\u2193', 'harr': '\u2194', 'crarr': '\u21b5', 'lArr': '\u21d0', 'uArr': '\u21d1',
		'rArr': '\u21d2', 'dArr': '\u21d3', 'hArr': '\u21d4', 'loz': '\u25ca', 'spades': '\u2660', 'clubs': '\u2663', 'hearts': '\u2665', 'diams': '\u2666', 'forall': '\u2200',
		'part': '\u2202', 'exist': '\u2203', 'empty': '\u2205', 'nabla': '\u2207', 'isin': '\u2208', 'notin': '\u2209', 'ni': '\u220b', 'prod': '\u220f', 'sum': '\u2211', 'minus': '\u2212',
		'lowast': '\u2217', 'radic': '\u221a', 'prop': '\u221d', 'infin': '\u221e', 'ang': '\u2220', 'and': '\u2227', 'or': '\u2228', 'cap': '\u2229', 'cup': '\u222a', 'int': '\u222b', 'there4': '\u2234',
		'sim': '\u223c', 'cong': '\u2245', 'equiv': '\u2261', 'sub': '\u2282', 'sup': '\u2283', 'nsub': '\u2284', 'sube': '\u2286', 'supe': '\u2287', 'oplus': '\u2295', 'otimes': '\u2297',
		'perp': '\u22a5', 'sdot': '\u22c5', 'laquo': '\u00ab', 'not': '\u00ac', 'macr': '\u00af', 'deg': '\u00b0', 'sup2': '\u00b2', 'sup3': '\u00b3', 'acute': '\u00b4', 'micro': '\u00b5',
		'para': '\u00b6', 'middot': '\u00b7', 'cedil': '\u00b8', 'sup1': '\u00b9', 'ordm': '\u00ba', 'raquo': '\u00bb', 'frac14': '\u00bc', 'frac12': '\u00bd', 'frac34': '\u00be', 'iquest': '\u00bf',
		'Agrave': '\u00c0', 'Aacute': '\u00c1', 'Acirc': '\u00c2', 'Atilde': '\u00c3', 'Auml': '\u00c4', 'Aring': '\u00c5', 'AElig': '\u00c6', 'Ccedil': '\u00c7', 'Egrave': '\u00c8', 'Eacute': '\u00c9',
		'Ecirc': '\u00ca', 'Euml': '\u00cb', 'Igrave': '\u00cc', 'Iacute': '\u00cd', 'Icirc': '\u00ce', 'Iuml': '\u00cf', 'ETH': '\u00d0', 'Ntilde': '\u00d1', 'Ograve': '\u00d2', 'Oacute': '\u00d3',
		'Ocirc': '\u00d4', 'Otilde': '\u00d5', 'Ouml': '\u00d6', 'Oslash': '\u00d8', 'Ugrave': '\u00d9', 'Uacute': '\u00da', 'Ucirc': '\u00db', 'Uuml': '\u00dc', 'Yacute': '\u00dd', 'THORN': '\u00de',
		'szlig': '\u00df', 'agrave': '\u00e0', 'aacute': '\u00e1', 'acirc': '\u00e2', 'atilde': '\u00e3', 'auml': '\u00e4', 'aring': '\u00e5', 'aelig': '\u00e6', 'ccedil': '\u00e7', 'egrave': '\u00e8',
		'eacute': '\u00e9', 'ecirc': '\u00ea', 'euml': '\u00eb', 'igrave': '\u00ec', 'iacute': '\u00ed', 'icirc': '\u00ee', 'iuml': '\u00ef', 'eth': '\u00f0', 'ntilde': '\u00f1', 'ograve': '\u00f2',
		'oacute': '\u00f3', 'ocirc': '\u00f4', 'otilde': '\u00f5', 'ouml': '\u00f6', 'oslash': '\u00f8', 'ugrave': '\u00f9', 'uacute': '\u00fa', 'ucirc': '\u00fb', 'uuml': '\u00fc', 'yacute': '\u00fd',
		'thorn': '\u00fe', 'yuml': '\u00ff', 'fnof': '\u0192', 'Alpha': '\u0391', 'Beta': '\u0392', 'Gamma': '\u0393', 'Delta': '\u0394', 'Epsilon': '\u0395', 'Zeta': '\u0396', 'Eta': '\u0397',
		'Theta': '\u0398', 'Iota': '\u0399', 'Kappa': '\u039a', 'Lambda': '\u039b', 'Mu': '\u039c', 'Nu': '\u039d', 'Xi': '\u039e', 'Omicron': '\u039f', 'Pi': '\u03a0', 'Rho': '\u03a1',
		'Sigma': '\u03a3', 'Tau': '\u03a4', 'Upsilon': '\u03a5', 'Phi': '\u03a6', 'Chi': '\u03a7', 'Psi': '\u03a8', 'Omega': '\u03a9', 'alpha': '\u03b1', 'beta': '\u03b2', 'gamma': '\u03b3',
		'delta': '\u03b4', 'epsilon': '\u03b5', 'zeta': '\u03b6', 'eta': '\u03b7', 'theta': '\u03b8', 'iota': '\u03b9', 'kappa': '\u03ba', 'lambda': '\u03bb', 'mu': '\u03bc', 'nu': '\u03bd',
		'xi': '\u03be', 'omicron': '\u03bf', 'pi': '\u03c0', 'rho': '\u03c1', 'sigmaf': '\u03c2', 'sigma': '\u03c3', 'tau': '\u03c4', 'upsilon': '\u03c5', 'phi': '\u03c6', 'chi': '\u03c7', 'psi': '\u03c8',
		'omega': '\u03c9', 'thetasym': '\u03d1', 'upsih': '\u03d2', 'piv': '\u03d6', 'bull': '\u2022', 'hellip': '\u2026', 'prime': '\u2032', 'Prime': '\u2033', 'oline': '\u203e', 'frasl': '\u2044',
		'weierp': '\u2118', 'image': '\u2111', 'real': '\u211c', 'alefsym': '\u2135', 'lceil': '\u2308', 'rceil': '\u2309', 'lfloor': '\u230a', 'rfloor': '\u230b', 'lang': '\u2329', 'rang': '\u232a',
		'OElig': '\u0152', 'oelig': '\u0153', 'Scaron': '\u0160', 'scaron': '\u0161', 'Yuml': '\u0178', 'circ': '\u02c6', 'tilde': '\u02dc', 'ensp': '\u2002', 'emsp': '\u2003', 'thinsp': '\u2009', 'zwnj': '\u200c',
		'zwj': '\u200d', 'lrm': '\u200e', 'rlm': '\u200f', 'ndash': '\u2013', 'mdash': '\u2014', 'lsquo': '\u2018', 'rsquo': '\u2019', 'sbquo': '\u201a', 'ldquo': '\u201c', 'rdquo': '\u201d', 'bdquo': '\u201e',
		'dagger': '\u2020', 'Dagger': '\u2021', 'permil': '\u2030', 'lsaquo': '\u2039', 'rsaquo': '\u203a', 'nbsp': '\u00a0', 'lt': '\u003c', 'gt': '\u003e'
	};

You can test with an editable iframe/div by pasting the original word content into it and inspecting what is pasted using the browser HTML inspector. You can use this demo which will render editable div and iframe in the browser after hitting the Run button - http://dojo.telerik.com/@nlazarov/IFIPAR.

As to RadEditor - you have two options to control the content and modify it as per your requirements:

Regards,
Rumen
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Editor
Asked by
Sushma
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or