Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#2001 closed Bug (invalid)

Numeric entities are not preserved

Reported by: richard Owned by:
Priority: Normal Milestone:
Component: Core : Output Data Version: FCKeditor 2.6 Beta
Keywords: Confirmed Cc:

Description

If I use the Insert Special Character dialog and choose a character that uses an entity number, e.g. ‛ or ► (right pointing triangle, in this case), intead of an entity name, e.g. ™ or •, the actual character goes into the editor window rather than the entity number/name (which can be viewed in source). On saving, the character is replaced with a question mark. I notice that if I paste an entity number into view source, then click out and back to source again, the number is converted to the name, except for numbers ‛ and ►. These are converted to the characters, which one save are replaced with question marks.

Change History (6)

comment:1 Changed 11 years ago by Wojciech Olchawa

Component: UI : Floating PanelCore : Output Data
Keywords: Pending added
Version: FCKeditor 2.6 Beta

Hi!

I can only confirm it partially. When you insert special characters ‛ and ► in the source view and go to WYSIWYG view and back again you will find the actual characters instead of their numbers. This happens in IE as well as in FF2.

However when it is for replacing characters with a question mark I can't confirm it. In my case the output was <p>‛ or ►</p> which is of course wrong. because it should be <p>&#8219; or &#9658;</p> .

So could you please chek if you have similar results using our demo page at:

http://www.fckeditor.net/demo

Thanks in advance.

comment:2 in reply to:  1 Changed 11 years ago by richard

Replying to w.olchawa:

Hi!

[...]

However when it is for replacing characters with a question mark I can't confirm it. In my case the output was <p>‛ or ►</p> which is of course wrong. because it should be <p>&#8219; or &#9658;</p> .

I think it is because when we save it to the db (MS SQL 2000), the db isn't recognizing the special character, so replaces it w/ a question mark. So the question mark is not the problem of FCK Editor, rather the problem is that FCK Editor is converting to the character, rather than leaving it's entity number, which results in the db saving it as a question mark.

Thank you

comment:3 Changed 11 years ago by Wojciech Olchawa

Keywords: Confirmed added; Pending removed

Confirmed with IE and FF2.

comment:4 Changed 11 years ago by Frederico Caldeira Knabben

Resolution: invalid
Status: newclosed
Summary: Insert Special Character saves question mark character when using entity number instead of entity name for two special charactersNumeric entities are not preserved

This problem is not related to the Insert Special Character dialog. It is enough to paste <p>&#8219; or &#9658;</p> in the source view. Switching back and forth to the WYSIWYG view, you will see that the entities are replaced with their relative chars.

This is a browser limitation. As soon as you feed the browser with entities, those are automatically translated to the specific character and the entities are lost. All we can do is replacing those chars with entities again, when outputting the HTML.

For numeric entities, this thing can't be done automatically because every single character can be transformed in an entity in this way.

But, we have a dedicated setting for that: AdditionalNumericEntities. So, just set the following in the configuration file and things will work for you:

FCKConfig.AdditionalNumericEntities = '‛|►' ;

Note that the raw chars are being used there.

comment:5 in reply to:  4 Changed 11 years ago by richard

Resolution: invalid
Status: closedreopened

Replying to fredck:

This problem is not related to the Insert Special Character dialog. It is enough to paste <p>&#8219; or &#9658;</p> in the source view. Switching back and forth to the WYSIWYG view, you will see that the entities are replaced with their relative chars.

This is a browser limitation. As soon as you feed the browser with entities, those are automatically translated to the specific character and the entities are lost. All we can do is replacing those chars with entities again, when outputting the HTML.

For numeric entities, this thing can't be done automatically because every single character can be transformed in an entity in this way.

I think these statements are not correct.

Other numeric entities, e.g. &#169; or &#174; , are converted in the editor to &copy; or &reg; respectively, when toggling source view. It seems (so far) that only &#8219; or &#9658; are "replaced with their relative chars."

Looking into this further, it appears that the editor cannot handle the conversion for any character that has a "number code" but not an "entity code". If this is the case, I question the inclusion of characters in the Insert Special Character dialog that do not have entity codes.

comment:6 Changed 11 years ago by Frederico Caldeira Knabben

Resolution: invalid
Status: reopenedclosed

Be sure that I'm correct richard.

The &#169; or &#174; numeric entities are part of the named entities supported by FCKeditor. So, as a results, they are automatically converted to &copy; or &reg; when outputting the editor data.

The &#8219; or &#9658; numeric entities instead have no named versions in the editor, so they are not automatically converted to entities.

As stated in my previous comment, you must use the AdditionalNumericEntities setting to indicate the additional characters that must be converted to numeric entities.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy