[Zope] Swedish characters and XMLDocument-1.0a4

Johan Carlsson johanc@torped.se
Mon, 20 Dec 1999 17:02:42 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_0018_01BF4B0C.076C6BE0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit


Here's some findings and suggestions:

A good idea would be to use the ACCEPT-CHARSET attribute of the
FORM element control what charset should be uses.

e.g.
<FORM ACCEPT-CHARSET=%Charsets>

Converting to UTF-8 automatically isn't a good solution
because neither Internet Explorer nor Navigator supports
ACCEPT-CHARSET="UTF-8".
Which suggest for defaulting to ISO-8859-1 or the CHARSET used by:
<META http-equiv="Content-Type" content="text/html; charset=CHARSET">.

[Patch files for UTF-8 edit files for XML Document included]

The problem with <META charset="UTF-8"> is that Netscape doesn't
handle it to well. Internet Explorer handles it just fine.
(Magnus original example document works great with <META charset="UTF-8">
 and Internet Explorer, Netscape almost handles it.)

The problems found in Netscape also indicates that XML Documents should
default to ISO-8859-1 to work properly. At least for now.

Regards,
Johan Carlsson






> Looks like the XML generation code doesn't like non-UTF encodings, and
> converts any non-UTF characters back to UTF-8 (which is what the ugly
> noise you quoted is). This isn't entirely _incorrect_ -- technically,
> the document's contents is still the same as what you put in -- but it
> certainly isn't _right_.
>
> Alexander Staubo
> mailto:alex@mop.no
> http://www.mop.no/~alex/
>
> >
> > > I'm not much of an expert on character sets, but the
> > default character
> > > encoding in XML is UTF-8, not ISO 8859 as with HTML.
> > Therefore, entering
> > > ISO characters will not translate correctly, and this might
> > account for
> > > your problems.
> > >
> > > To specify that the document contents is encoded in ISO
> > 8859-1 (ie., ISO
> > > Latin 1), modify the document heading to say:
> > >
> > >         <?xml version="1.0" encoding="ISO-8859-1"?>
> >
> > Well... I add that into the document:
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <faq>
> >   <entry>
> >     <test>Långt svårt öppningshål</test>
> >   </entry>
> > </faq>
> >
> >
> > Then I hit "Change", and the saved version will look like this:
> >
> > <?xml version="1.0"?>
> > <faq>
> >   <entry>
> >     <test>Långt och svårt öppningshål</test>
> >   </entry>
> > </faq>
> >
> > Encoding is removed, and I cant say the text is what I want
> > it to be :-P
> >
> > Time to buy a XML-book... or maybe it is a bug? I dont know.
> >
> > /Magnus Heino
> >
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>

------=_NextPart_000_0018_01BF4B0C.076C6BE0
Content-Type: application/octet-stream;
	name="elementEdit.dtml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="elementEdit.dtml"

<HTML>
<HEAD>
<TITLE>Edit</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<!--#var manage_tabs-->

  <FORM ACTION="manage_edit" METHOD="POST">
    <TABLE CELLSPACING="2">
      <TR>
    <TH ALIGN="LEFT" VALIGN="TOP">Id</TH>
    <TD ALIGN="LEFT" VALIGN="TOP"><!--#var id--></TD>
      </TR>
      <tr>
    <th align="left" valign="top">
        <em>Size</em>
        </th>
    <td align="left" valign="top">
        <!--#var get_size thousands_commas--> bytes
    </td>
      </tr>
      <tr>
    <th align="left" valign="top">
        <em>Last modified</em>
        </th>
    <td align="left" valign="top">
        <!--#var bobobase_modification_time-->
    </td>
      </tr>
      <TR>
    <TD COLSPAN="2" ALIGN="CENTER">
    <TEXTAREA NAME="data:text" WRAP="Off"
    <!--#if dtpref_cols-->
    COLS="<!--#var dtpref_cols-->"
    <!--#else dtpref_cols-->
    COLS="50"
    <!--#/if dtpref_cols-->
    <!--#if dtpref_rows-->
    ROWS="<!--#var dtpref_rows-->"
    <!--#else dtpref_rows-->
    ROWS="20"
    <!--#/if dtpref_rows-->><!--#var 
        toXML html_quote--></TEXTAREA>
    </TD>
      </TR>
      <TR>
    <TD align=left>
          <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Change">
    </TD>
    <TD align=left>
      <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Taller">
      <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Shorter">
      <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Wider">
      <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Narrower">
    </TD>
      </TR>
    </TABLE>
  </FORM>
</BODY>
</HTML>


------=_NextPart_000_0018_01BF4B0C.076C6BE0
Content-Type: application/octet-stream;
	name="documentEdit.dtml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="documentEdit.dtml"

<HTML>
<HEAD>
<TITLE>Edit</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<!--#var manage_tabs-->

  <FORM ACTION="manage_edit" METHOD="POST" >
    <TABLE CELLSPACING="2">
      <TR>
    <TH ALIGN="LEFT" VALIGN="TOP">Id</TH>
    <TD ALIGN="LEFT" VALIGN="TOP"><!--#var id--></TD>
      </TR>
      <TR>
    <TH ALIGN="LEFT" VALIGN="TOP"><EM>Title</EM></TH>
    <TD ALIGN="LEFT" VALIGN="TOP">
    <!--#if title-->
    <INPUT TYPE="TEXT" NAME="title" SIZE="40" VALUE="<!--#var title-->">
    <!--#else title-->
    <INPUT TYPE="TEXT" NAME="title" SIZE="40" VALUE="">
    <!--#/if title-->
    </TD>
      </TR>
      <tr>
    <th align="left" valign="top">
        <em>Size</em>
        </th>
    <td align="left" valign="top">
        <!--#var get_size thousands_commas--> bytes
    </td>
      </tr>
      <tr>
    <th align="left" valign="top">
        <em>Last modified</em>
        </th>
    <td align="left" valign="top">
        <!--#var bobobase_modification_time-->
    </td>
      </tr>
      <TR>
    <TD COLSPAN="2" ALIGN="CENTER">
    <TEXTAREA NAME="data:text" WRAP="Off"
    <!--#if dtpref_cols-->
    COLS="<!--#var dtpref_cols-->"
    <!--#else dtpref_cols-->
    COLS="50"
    <!--#/if dtpref_cols-->
    <!--#if dtpref_rows-->
    ROWS="<!--#var dtpref_rows-->"
    <!--#else dtpref_rows-->
    ROWS="20"
    <!--#/if dtpref_rows-->><!--#var 
        toXML html_quote--></TEXTAREA>
    </TD>
      </TR>
      <TR>
    <TD align=left>
          <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Change">
    </TD>
    <TD align=left>
      <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Taller">
      <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Shorter">
      <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Wider">
      <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Narrower">
    </TD>
      </TR>
    </TABLE>
  </FORM>
</BODY>
</HTML>


------=_NextPart_000_0018_01BF4B0C.076C6BE0--