Last Comment Bug 6588 - implement "User-Defined" charset
: implement "User-Defined" charset
[nsbeta2+]Exception Feature (ETA-6/9)
: pp, relnote
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: All Other
P3 normal with 1 vote (vote)
: M17
Assigned To: Gary L. Wade
: Chris Petersen
: Jet Villegas (:jet)
: 7569 (view as bug list)
Depends on: 8280
  Show dependency treegraph
Reported: 1999-05-17 14:31 PDT by Erik van der Poel
Modified: 2005-03-17 13:34 PST (History)
7 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Erik van der Poel 1999-05-17 14:31:06 PDT
The old Communicator code base has a menu item labelled "User-Defined" in the
charset menu. We probably need to support this in the new Mozilla.

For all ASCIIs (0x00 - 0x7F), just map directly to Unicode (U+0000 - U+007F).
All other byte values (0x80 - 0xFF) should be mapped to the Unicode Private Use
Area (U+E000 - U+F8FF). More specifically, U+E000 - U+E07F. In the font engine,
we map in the opposite direction, to get back the original bytes, and then use
whatever font the user has chosen for User-Defined.

On Windows, we obviously cannot use the "W" functions (GetTextExtentPoint32W
and ExtTextOutW), since they expect Unicode, and wouldn't know what to do with
PUA characters. So let's use the "A" functions. The old code base used
ANSI_CHARSET in LOGFONT to accomplish this.

On Unix, just convert back to the original bytes, and pass them to the 8-bit
measure/draw functions. (Consistent with old code base.)

On Mac, convert back to the original bytes, and do whatever the old code base

Need to spec out the charset issues too. E.g. if HTTP/META charset is unknown,
and User-Defined menu item is selected, use that. If HTTP/META charset is
known, but user has used the override feature to specify User-Defined, use
Comment 1 User image Erik van der Poel 1999-05-19 16:52:59 PDT
From: (Yung-Fong Tang)

I propose we do the following
1. Create a "user defined" encoding converter which convert 0x80-0xFF to
U+F780 - U+F7FF back and forth.

Rational of the mapping range
1. The Private Use Area is defined from U+E000 - U+F8FF
2. Apple use U+F8A1 to U+F8FF for Apple specific chars.
3. Microsoft use U+E000 - U+EDE7 for Chinese/Japananese/Korean EUDC chars

1. How we convert 0x01 - 0x1F ? I know some hacky encoding use some chars in
that range for some human readable text instead of control code.
Comment 2 User image bobj 1999-06-25 18:14:59 PDT
Do we have a list of the hacking encodings that use the 0x01 - 0x1F range?
Comment 3 User image Erik van der Poel 1999-07-02 20:56:59 PDT
Some additional info from bug 7569:

Till netscape 4.51, users were able to install their own *.bdf fonts
and view pages meant for that font.

Is their any provision like that in SeaMonkey now?
The page give uses fonts from

This font is very popular in Tamil language(of India)

(End of excerpt.)

I downloaded the fonts from the above site, and had a look. They appear to use
normal ASCII in the 0x00-0x7F range, which is good news.
Comment 4 User image Erik van der Poel 1999-07-02 20:56:59 PDT
*** Bug 7569 has been marked as a duplicate of this bug. ***
Comment 5 User image bobj 1999-07-09 16:20:59 PDT
Moved to M10
Comment 6 User image Erik van der Poel 1999-07-15 20:55:59 PDT
Note to myself:

+           /*
+            * XXX Turn prevFont into an object with GetWidth and DrawString
+            * methods. The object should do one of the following:
+            * 1. call the "W" function for normal Unicode strings,
+            * 2. call the "A" function for User Defined,
+            * 3. call the "A" function for Symbol, or
+            * 4. return the width of several boxes for missing glyphs.
+            */
            ::SelectObject(mDC, prevFont->font);
            ::GetTextExtentPoint32W(mDC, &aString[start], i - start, &size);
Comment 7 User image leger 1999-08-30 15:27:59 PDT
Adding to cc list.
Comment 8 User image bobj 1999-11-11 13:30:59 PST
post-Beta1 feature
Comment 9 User image Erik van der Poel 2000-01-24 16:27:23 PST
Moving all M16s to M17. Please make comments if you disagree.
Comment 10 User image bobj 2000-03-11 16:39:33 PST
Since this appears in the UI, we should release note that this is not done
for Beta1.
Comment 11 User image bobj 2000-03-26 00:15:19 PST
Shouldn't this be in by Beta2, therefore by M16?
Comment 12 User image Erik van der Poel 2000-04-14 10:21:23 PDT
Hi Juraj, Bob and I thought that this might be a good one for you. Let's
discuss this when you have finished your other tasks.
Comment 13 User image (away - not reading bugmail) 2000-04-14 14:27:32 PDT
Hi Erik,

looks like fun, I'm taking it on board :-) I hope to be finished with the accept 
language UI soon, maybe we can talk then...
Comment 14 User image Erik van der Poel 2000-05-15 14:10:24 PDT
I checked in the User-Defined support for Unix. Now I will work on Windows.
Re-assigning to myself.
Comment 15 User image (away - not reading bugmail) 2000-05-15 17:14:10 PDT
for some reason I still apprear as owner of this bug; reassigning to erik
Comment 16 User image Erik van der Poel 2000-05-16 16:49:54 PDT
Checked in User Defined support for Windows. Over to Frank for the Mac.
Comment 17 User image Frank Tang 2000-05-16 17:17:54 PDT
move to M17
Comment 18 User image leger 2000-05-16 17:18:44 PDT
Putting on [nsbeta2+][5/16] radar.  I18n would REALLY like this in for beta2.
Comment 19 User image Frank Tang 2000-05-22 12:58:16 PDT
Comment 20 User image bobj 2000-05-22 17:21:39 PDT
Added keywords: pp  (works on Win and Linux, but not Mac), and
                4xp (been a browser feature for years).
Comment 21 User image leger 2000-05-30 18:06:42 PDT
On exception list for PR2, removing 5/ [nsbeta2+]Exception Feature 
Comment 22 User image Frank Tang 2000-06-06 12:23:05 PDT
ascii part is convert to ASCII part in Unicode.
80-FF is convert to F780 to F7FF in unicode 
Comment 23 User image Frank Tang 2000-06-07 17:09:09 PDT
add ETA info for gary
Comment 24 User image Gary L. Wade 2000-06-14 16:44:42 PDT
Changed the following files to add this new feature and to make the font settings 
changes more complete, as referenced in Bug 30300.

Comment 25 User image Chris Petersen 2000-06-20 12:41:21 PDT
Marking verified fixed in June 20th build.

Note You need to log in before you can comment on or make changes to this bug.