Opened 10 years ago

Closed 9 years ago

#7564 closed Bug (invalid)

Entities in attributes

Reported by: datalink Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Cc:


I work with files on windows, think that's the problem.

If I have german word "Frühling" in img alt attribute, ckeditor change it to "Frühling" after first saving, to "Frühling" after second and so on. Same with other attributes like content in meta tags or title in h1 tags. config.entities = true; has no effect.

Change History (6)

comment:1 Changed 10 years ago by Jakub Ś

Status: newpending

Have you tried to reproduce this problem in demo page ( Ajax example can be used for issue that you described.

I'm asking because this looks like a problem with encoding inside your application (or plug-in you are creating) not with CKEditor itself. Perhaps you have forgotten to set UTF-8 (or other encoding ) in some place?

comment:2 Changed 10 years ago by datalink

I open demo version, switch to source and copy "Frühling" as alt to image. I switch to wysiwyg and back to source, ckeditor change "Frühling" to "Frühling".

On my local system I do following steps:
HTML page has source with "Frühling" as alt attribute.
Load page to editor, firefox source is "Frühling" - ckeditor sourcearea shows "Frühling" (I think it's double encoded)
Save page with php, HTML source is "Frühling"
Reopen page with editor, firefox source is "Frühling" - ckeditor sourcearea shows "Frühling"

Hope this helps.

comment:3 Changed 10 years ago by Jakub Ś

Status: pendingconfirmed

CKEditor is using UTF-8 encoding. You are probably using ISO in your application. When you paste an image with an alt attribute that contains HTML entities they are translated to human-readable characters in UTF-8. When you save the file, your application doesn't recognize encoding and that is why you are having problems. A quick workaround would be to switch your application to UTF-8.

The only problem with CKEditor is: why is it translating HTML entities if documentation says that HTML entities should be used in HTML code by default ( Is it a bug or some sort of by design feature?

comment:4 Changed 10 years ago by datalink

Many, many hours later...

Think I find the mistake. My Applikation is in utf-8 and loads content with htmlentities($content). That makes ü from ü. Changes to htmlspecialchars($content) solved it.

comment:5 Changed 10 years ago by Jakub Ś

Keywords: Discussion added

comment:6 Changed 9 years ago by Jakub Ś

Keywords: Discussion removed
Resolution: invalid
Status: confirmedclosed
Note: See TracTickets for help on using tickets.
© 2003 – 2020 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy