Closed Bug 179525 Opened 22 years ago Closed 21 years ago

Composer not use   while saving file, instead it place code like 0xff in pure CP866 (looks like 0x20 - space)

Categories

(Core :: DOM: Editor, defect)

x86
Other
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: evgen_k, Assigned: mozeditor)

References

Details

User-Agent:       Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.2b) Gecko/20021030
Build Identifier: Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.2b) Gecko/20021030

Open new page with Composer, type "bla<space><space>bla" then save file and look
at it. I see
View: E:\WWW\TEST\bla.html                                         CP866 100.00%
00000000 3C 21 44 4F � 43 54 59 50 � 45 20 68 74 � 6D 6C 20 50  <!DOCTYPE html P
00000010 55 42 4C 49 � 43 20 22 2D � 2F 2F 57 33 � 43 2F 2F 44  UBLIC "-//W3C//D
00000020 54 44 20 48 � 54 4D 4C 20 � 34 2E 30 31 � 20 54 72 61  TD HTML 4.01 Tra
00000030 6E 73 69 74 � 69 6F 6E 61 � 6C 2F 2F 45 � 4E 22 3E 3C  nsitional//EN"><
00000040 68 74 6D 6C � 3E 3C 68 65 � 61 64 3E 3C � 6D 65 74 61  html><head><meta
00000050 20 68 74 74 � 70 2D 65 71 � 75 69 76 3D � 22 63 6F 6E   http-equiv="con
00000060 74 65 6E 74 � 2D 74 79 70 � 65 22 20 63 � 6F 6E 74 65  tent-type" conte
00000070 6E 74 3D 22 � 74 65 78 74 � 2F 68 74 6D � 6C 3B 20 63  nt="text/html; c
00000080 68 61 72 73 � 65 74 3D 4B � 4F 49 38 2D � 52 22 3E 3C  harset=KOI8-R"><
00000090 74 69 74 6C � 65 3E 62 6C � 61 3C 2F 74 � 69 74 6C 65  title>bla</title
000000A0 3E 3C 6D 65 � 74 61 20 6E � 61 6D 65 3D � 22 61 75 74  ><meta name="aut
000000B0 68 6F 72 22 � 20 63 6F 6E � 74 65 6E 74 � 3D 22 65 76  hor" content="ev
000000C0 67 22 3E 3C � 2F 68 65 61 � 64 3E 3C 62 � 6F 64 79 3E  g"></head><body>
000000D0 62 6C 61 20 � 9A 62 6C 61 � 3C 2F 62 6F � 64 79 3E 3C  bla ÿbla</body><
000000E0 2F 68 74 6D � 6C 3E                                    /html>

Please look at 
000000D0 62 6C 61 20 � 9A 62 6C 61 �
That is my bla<space><space>bla
Code 9A is wrong code and should be replaced with &nbsp;

Moreover, my current codepage is CP866, but the codepage for saved html is as
you can see  Charset=KOI8-R
So that code 0x9A is obtained from 0xFF with conversion table from KOI8-R to CP866.

It seems that 
(a) Someboby code in source code &nbsp; via 0xff and at file  saving doesn't
convert 0xff to &nbsp; - that is wrong
(b) instead he translates such simboles according to some rule  from Composer's
codepage to system's codepage - this also is wrong (may be?)


Reproducible: Always

Steps to Reproduce:
1. Open Composer with new page
2. type "bla<space><space>bla"
3. save file as bla.html
4. Look at bla.html
May be system's codepage should be not the same as Composer's

Actual Results:  
<body>bla ÿbla</body>
i.e.
<body>bla 0x20 0x9a bla</body>

Expected Results:  
<body>bla &nbsp;bla</body>
i.e.
<body>bla 0x20 &nbsp;bla</body>
Oh,
This bug look as it is very close to Bugzilla Bug 171405
Depends on: 171405
-->editor:core
Assignee: syd → jfrancis
Component: Editor: Composer → Editor: Core
ftang--this sounds like a charset problem; who from your team can investigate
this bug?
The codepage for the saved HTML is determined by what you have selected in the
character coding menu in composer.

I have tested your scenario with current builds and it works. No more odd character.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.