Composer changes the format (hexadecimal to decimal) of entities




16 years ago
10 years ago


(Reporter: ernestcline, Unassigned)


(Blocks: 2 bugs)

Windows 98
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)




16 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3) Gecko/20030312
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3) Gecko/20030312

Composer chooses to represent entities that it saves in decimal form such as
dz instead of hexadecimal form such as dz . I prefer this form as it
corresponds to the way that Unicode presents its code numbers. If I understand
correctly, this choice was made in part because of desire to support a certain
obsolete browser that has probems with the hexadecimal entities. However,
support for that browser is not important to me, and the use of hexadecimal
entities is.

This bug is similar to Bug 174216. However, that bug deals with the appearance
of entities in Composer; this bug is about how they are saved.

Reproducible: Always

Steps to Reproduce:
1. Go to the View Source pane
2. Put a hexadecimal entity such as dz into the file.
3. Save the file.
4. Read the file in a text editor.

Actual Results:  
The entity was saved as dz

Expected Results:  
The entity should have been saved in the form it was entered.

Mozilla is also changing entities into named entities or ASCII.

May I suggest the following preference UI:

( ) Save entities as characters in the file charset when possible.
( ) Save entities as named entities when possible.
Save numeric entities as:
   ( ) entered.
   ( ) decimal.
   ( ) hexadecimal.
   ( ) hexadecimal pairs.

The last choice would force the entity to be saved as either two, four, or six
hexadecimal digits as needed.

Comment 1

16 years ago
-->DOM to Text Conversion
may be a duplicate bug
Assignee: composer → harishd
Component: Editor: Composer → DOM to Text Conversion
Ever confirmed: true
QA Contact: petersen → sujay


16 years ago
Blocks: 174361

Comment 2

15 years ago
*** Bug 229645 has been marked as a duplicate of this bug. ***


15 years ago
Blocks: 144810

Comment 3

14 years ago
There is a hidden pref to control how entities are saved by the editor. It has
no UI, but you can manually set it to what you prefer.

user_pref("editor.encode_entity", "none");
 * "none"   : don't use any entity names; only use numeric codes.

user_pref("editor.encode_entity", "basic");
 * "basic"  : use entity names just for   & < > " for 
 *            interoperability/exchange with products that don't support more
 *            than that.

user_pref("editor.encode_entity", "latin1");
 * "latin1" : use entity names for 8bit accented letters and other special
 *            symbols between 128 and 255.

user_pref("editor.encode_entity", "html");
 * "html"   : use entity names for 8bit accented letters, greek letters, and
 *            other special markup symbols as defined in HTML4.


14 years ago
Summary: Composer changes the format of entities → Composer changes the format (hexadecimal to decimal) of entities
Assignee: harishd → nobody
QA Contact: sujay → dom-to-text
You need to log in before you can comment on or make changes to this bug.