Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with accents

0 views
Skip to first unread message

Fabrice

unread,
Feb 9, 2007, 8:17:00 AM2/9/07
to
Hello,
The problem: EW deletes all the letters with accents (html codes or not)
included in aspx pages (xhtml T 1.0 ) derived from a master page, each time I
open the file. Even the accents in the comments from Visual Studio are
deleted. But I still can save pages with accents.

I tried to set the encoding of the page and web site to ISO west europe,
but the problem is still here.
Has anyone experienced this problem ?

Thank you.
Fabrice

Christoph Schneegans

unread,
Feb 12, 2007, 6:04:07 PM2/12/07
to
"Fabrice" wrote:

> The problem: EW deletes all the letters with accents (html codes or
> not) included in aspx pages (xhtml T 1.0 ) derived from a master
> page, each time I open the file.

This can happen when Expression Web thinks that your file is UTF-8 encoded
but actually isn't. Go to "File > Properties... > Language" and select
"US/Western European (ISO)" from the "Reload the current document as"
combobox. If you can see letters with accents then, open that dialog again
and choose the same encoding from the "Save the document as" combobox and
click OK.

Fabrice

unread,
Feb 13, 2007, 5:45:00 AM2/13/07
to
Thank you for your help Christoph,

But it still doesn't work because whatever the option I choose the "Reload
the current document as" combobox always come back to "automatic encoding" by
default. I just can't apply a different option to any file of my web site.
This particular setting must be saved somewhere in the web site settings I
imagine. Since my web site has been created with Visual Studio 2005, it is
maybe a web site definition issue. But I can't find where to change it.

Christoph Schneegans

unread,
Feb 13, 2007, 6:58:18 AM2/13/07
to
"Fabrice" wrote:

> But it still doesn't work because whatever the option I choose the "Reload
> the current document as" combobox always come back to "automatic encoding" by
> default.

Strange. You should first determine how your file is actually encoded.
To do this, open it with Notepad, choose "File > Save as..." and tell
me if you can read "ANSI" or "UTF-8" in the "Encoding" combobox. Do
not actually save the file, but cancel the dialog.

The file might also contain a byte-order mark. To check if this is the
case, download
<http://schneegans.de/frontpage/utf-8/has-bom.vbs> e.g. to your
Desktop, and drag your file on it.

Also check if there's an encoding declaration such as

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"

in the "head" element of that file.

Fabrice

unread,
Feb 13, 2007, 7:40:00 AM2/13/07
to
Thank you for your script: "No BOM detected" with my pages (aspx or master)
Notepad: It seems to be "ansi".
header: in my master page: <meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1" />

- The problem seems to be linked to the use of a master page, because if I
create a simple aspx page (without masterpage) directly from EW there is no
problem with encoding and accent.
- Wheras in a page created from a master page (from visual studio) I can't
set the language and encoding (combobox are inactive): it inherits the master
page settings, which is logical and good.
- But in EW i can't change the encoding of the master page at reloading : it
always comes back to "automatic encoding" ! => EW probably apply this setting
to the aspx pages I open.

Christoph Schneegans

unread,
Feb 13, 2007, 2:15:30 PM2/13/07
to
"Fabrice" wrote:

> The problem seems to be linked to the use of a master page, because if
> I create a simple aspx page (without masterpage) directly from EW
> there is no problem with encoding and accent.

Yes, you are right. I now have reconstructed the problem. There are several
factors that need be considered. By default, Expression Web prefers UTF-8
when no explicit encoding declarations are available, while Visual Studio
still prefers Windows-1252 in such a case. This is absolutely idiotic since
the use of Windows-1252 is limited to America und Western Europe, while
UTF-8 can encode _any_ script. Furthermore, .aspx pages that are attached to
a Master page cannot contain a "meta" element which is otherwise used to
explicitly declare the character encoding of a file.

There seem to be two ways to solve your problem. The simple, but IMO dirty
one is to go to "Site > Site Settings... > Language" and change "Unicode
(UTF-8)" e.g. to "US/Western European (ISO)". This setting affects how EW
decodes files that do not declare their encoding explicitly. I do not
recommend this approach is because you rely on default settings in the
editor. If anything goes wrong in the future, EW might default to UTF-8
again. This is really dangerous because if you save the page then, your
accented letters will vanish and you cannot reconstruct them.

The clean but maybe more time-consuming solution is to recode all pages to
UTF-8. Open your Master page, go to "File > Properties... > Language" and
select "Unicode (UTF-8)" from the "Save the document as" list. You then have
to recode all pages that are attached to your Master page. To do this, open
them in Notepad one by one, select "File > Save as..." and use "UTF-8".
Notepad likes to append a .txt extension, make sure to remove it. Both
Notepad and Expression Web use byte-order marks for UTF-8 encoded files. A
byte-order mark in a file is an unambiguous sign that UTF-8 was used to
encode it so any recent software knows how to decode it and does not need to
guess.

It might be possible to automate the recoding operation with the help of a
VBA macro such as
<http://google.com/groups?selm=e7rpro.io.1%40news.christoph.schneegans.de>,
but I'm not sure whether this works with .aspx pages attached to a Master
page. In any case, I would backup my files before I continue. You should
also check that Visual Studio will read UTF-8 encoded files properly, but I
don't expect any problems. And don't blame EW. It's Visual Studio's fault to
use a legacy encoding.

0 new messages