Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Some UTF8 files revert to western encoding when reopened.

New Here ,
Sep 25, 2009 Sep 25, 2009

I'm using Dreamweaver CS3, and when I built an application I forgot to ensure that the encoding was set to UTF8.

I went through all my files and changed the encoding from western european to UTF8. This was fine until I noticed that SOME files revert back to western european encoding when re-opened.

No matter how many times I change the encoding back ( using ctrl+j and choosing the dropdown in page properties ) and save the files, it STILL reverts back to western when opened.

This only seems to happen on certain files, and some are fine. I've tried creating a new file in UTF8 and copying the contents of the old one into it. The problem persists so I'm thinking that the file may contain odd characters that are causing Dreamweaver to 'intelligently' change the encoding.

Any ideas are welcomed. Many thanks.

TOPICS
Server side applications
9.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 25, 2009 Sep 25, 2009

Files that contain HTML have the character encoding in a meta tag in the head of the page. Dreamweaver uses that for the encoding. If you are using files that don't contain the meta tag, Dreamweaver uses the default encoding set in Preferences. Open the Preferences panel and select the New Document category. Set encoding to UTF-8.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 25, 2009 Sep 25, 2009

Hi David, thanks for your reply.

Unfortunately this was one of the first things I changed when I decided I'd better change my app to use UTF8.

http://dl.getdropbox.com/u/240752/dw.png

I've simulated this problem on windows too, rebooted etc. Its very odd indeed. I'm stumped as to why it changes some and not others, the ones that work and the ones that don't all have no meta tags as they are snippets of html.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 25, 2009 Sep 25, 2009

How odd. Sorry, I don't know the answer.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 03, 2009 Oct 03, 2009

A workaround is to insert a comment

Example:

Open a JavaScript file and convert to utf-8 and then insert:
// æø

Then save

Then open the file and ctrl + j - and it should be utf-8 (or stand utf-8)

Looks like if you dont use any spesial characters then it's no need for utf-8.

If you make a new file test.js and insert a spesial character then you will get a warning that the current encoding cant correctly save all characters and you may want to convert to utf-8 or another.

Try with: è«‹

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 03, 2012 Oct 03, 2012

Should I include BOM?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 06, 2012 Oct 06, 2012

Adding the BOM to PHP files causes problems with headers (at least it did in the past -- I haven't tried recently).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 04, 2009 Oct 04, 2009

So, you do have the following tag in your headers:

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 08, 2009 Oct 08, 2009

I consider this a serious bug. It actually breaks applications unless Stephen's workaround is applied, or the encoding is manually re-set to UTF-8 after a change was made that introduced a non-iso-8859-1 character.

Is there a place to report bugs at Adobe, or can we assume the Dreamweaver development team reads this forum?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 08, 2009 Oct 08, 2009

Yes it is a serious bug.

I bring this issue some months ago:

http://forums.adobe.com/thread/85998?tstart=0

Hopefully they will fix it in the next patch. Or in CS5 at least.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 12, 2009 Oct 12, 2009

I use lots of files that don't have headers, such as PHP includes which include snippets of HTML.

CS3 seems to look for special characters in the file and IF there are UTF-8 encoded chracters in the file AND it is saved as such, it'll remember that when reopening it. However, if there are NO UTF-8 characters in there and you save it as UTF-8, then CS3 will revert back to another encoding (western or some such...), regardless of the setting in preferences (for files without explicit headers).

This is a pain because some of my PHP includes may or may not contain Korean characters (multi-language site) and if I do add them, then I need to remember to switch the encoding to UTF-8 manually. It's just annoying that the global preferences, AREN'T!

I'll be upgrading to CS4 this week so I'll let you know if it's an issue there too.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 05, 2009 Nov 05, 2009

I have the same problem in CS4, actually it's worse.Because of a searchfunction my xhtmlpage needs to be utf-8 and no matter how I save the page (preferences, pageproperties, character encoding in header) it only shows up wrong when uploaded. When I try changing the browser language to western encoding it works, although the page is totally utf-8. This really really sucks when making scandinavian sites... Has anyone found a workout for this bug?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 11, 2009 Nov 11, 2009

Have a look at Stephen Nor's post - he mentioned the workaround that does the trick: Add a comment that contains at least one Non-ASCII character, so DW will remember the encoding.

I really hope Adobe takes the encoding topic seriously. I sent a feature request to Macromedia years ago, suggesting to set the encoding per site rather than in the global preferences. I'd expect a proper code editor to handle this kind of stuff in an easy and reliable way. I don't think I'd bother upgrading to any new CS version unless this is solved.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 26, 2009 Nov 26, 2009

Hello there,

exact same problem here, worst point is that i am juggling with encodings in a PHP script which works in cunjunction with dompdf library.

As dompdf do not handle utf8 i had to use utf8_encode() in my script to switch from one encoding (from my database) to the pdf document, but as i worked on the script DW changed the whole page encoding to iso-xxx so my utf8_encode() calls ended-up breaking everything in the generated pdf... I don't even mention all the hassle it has been to understand that bug and where it was coming from.

Now, though the //Å“ comment trick within the document works out, it is ridiculous that a software do not stick with the encoding the user specify as the one he wishes to work with in the preferences. As if DW knew better than us what encoding we want to use with :s

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 26, 2009 Nov 26, 2009

Thanks for the replies all, it looks like this is quite a big problem for some people. I see that this bug has been reported by Burak Ueda a while back, but it would be great if someone from Adobe could comment on this and let us know if its a planned fix.

Anyone know a good way of attracting their attention?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 26, 2009 Nov 26, 2009

Chris Pickle wrote:

Thanks for the replies all, it looks like this is quite a big problem for some people. I see that this bug has been reported by Burak Ueda a while back, but it would be great if someone from Adobe could comment on this and let us know if its a planned fix.

Anyone know a good way of attracting their attention?

I can assure that Adobe is well aware of this issue. I brought it to their attention several versions ago, and have campaigned quietly with several others for something to be done about it. I think the message is finally getting through.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 12, 2012 Oct 12, 2012

I just ran into something similar while applying Dreamweaver templates - and discovered an odd work-around which still beats any alternative, in my case: http://forums.adobe.com/thread/1075583

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 12, 2012 Oct 12, 2012
LATEST

It's CS5 that I'm using - will be testing CS6 soon though; there are supposed to be *some* UTF-8 related bug fixes in it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines