Problems with “replace in all open documents”-command

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
Johan Edlund
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 5
Joined: Mon Jan 18, 2016 2:34 pm

Problems with “replace in all open documents”-command

Post by Johan Edlund » Mon Jan 18, 2016 3:22 pm

Hello.

I have recently installed CSE HTML Validator Std v16.01 on my W10-computer and made some “replace in all open documents”-commands for my web pages.

After “replace in all open documents”-commands was made two strange things has happened.

First, when I replace <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> with <meta charset="utf-8"> all my Swedish characters (åäöÅÄÖ) has been replaced by �. I will appear when I save the document, close the document and open the document again.

Second, some characters have just disappeared. The characters who has disappeared is random in the documents. For example, in some documents the &nbsp; is replaced by &bsp;, </html> tag is missing the last >. I have made this command several times with earlier versions of the CSE HTML Validator program without this kind of problems.

Is it a bug in 16.01?

Please help me!

Johan Edlund

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Problems with “replace in all open documents”-command

Post by Albert Wiersch » Mon Jan 18, 2016 4:31 pm

Hi Johan,

I'm sorry for the trouble.

I suspect this is a problem with the encoding. You can't simply change a document's encoding by changing the meta tag. Newer versions of CSE HTML Validator handle encoding better and I suspect CSE HTML Validator v16 sees the new utf-8 meta tag and so it tries to load the document as utf-8 when it hasn't been properly converted to utf-8.

Please try these steps to convert to utf-8:

1. Load the document as usual.
2. Go to 'File->Save with Encoding' or hold down the SHIFT key and press Ctrl+S or hold down the SHIFT key and go to 'File->Save'.
3. For the 'Encoding' option, select 'Unicode (UTF-8)'. Uncheck 'Use encoding signature' if it's checked (it probably isn't checked).
4. Click OK to save the document as UTF-8.
5. Perform your meta tag replace to indicate that the document is now utf-8.
6. Close and reload to verify your document has been converted properly.

Please let me know if this works.
Image
Albert Wiersch

Johan Edlund
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 5
Joined: Mon Jan 18, 2016 2:34 pm

Re: Problems with “replace in all open documents”-command

Post by Johan Edlund » Tue Jan 19, 2016 3:23 am

Hello again.

It worked to save with encoding.
Does this means that I manually have to save each document with encoding or does the program has a short cut for this type of mass operation?

Is it possible in coming versions of the program that you can see encoding changes before closing and realoading the document?

My other problem with disappearing characters is still happening after using "Replace in all open documents" and when I use “Save All” (with wrong encoding) but will not appear when I use “Save with Encoding”.

Johan

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Problems with “replace in all open documents”-command

Post by Albert Wiersch » Tue Jan 19, 2016 8:20 am

Hi Johan,

Great; I'm glad that worked.

Sorry, you'll need to manually change the encoding for each document as there is no automated way to do this. There may be another software program you can use to do this automatically but I am not aware of any off the top of my head. Fortunately you should only have to do it once for each document.

As for looking for encoding changes I'll have to think about that in more detail for a future version. There may be something I can do.

After manually converting the documents to utf-8 and then changing the meta tag to utf-8, have you run into any problems? As long as you don't change the encoding specified in the meta tag without also changing the actual file encoding, then I don't think you should run into any issues. That is, the encoding in the meta tag must match the actual file encoding or there could be problems.
Image
Albert Wiersch

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Problems with “replace in all open documents”-command

Post by Albert Wiersch » Tue Jan 19, 2016 2:30 pm

Hi Johan,

I'm curious... how many documents are you converting to utf-8? Is it so many that you need an automated way to do this?
Image
Albert Wiersch

Johan Edlund
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 5
Joined: Mon Jan 18, 2016 2:34 pm

Re: Problems with “replace in all open documents”-command

Post by Johan Edlund » Wed Jan 20, 2016 2:08 pm

Hello!

I have tested several documents and no problems at all after I followed your instructions.

Thank you for your valuable support and a very good program!

Johan Edlund

Johan Edlund
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 5
Joined: Mon Jan 18, 2016 2:34 pm

Re: Problems with “replace in all open documents”-command

Post by Johan Edlund » Fri Feb 05, 2016 12:18 am

Hello again!

Sorry for the delay for my answer to your question above about the number of document.
I have approximately 530 html documents to convert, so a command “convert all documents” would help me a lot to speed up the conversion.

Johan Edlund

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Problems with “replace in all open documents”-command

Post by Albert Wiersch » Fri Feb 05, 2016 9:34 am

Hi Johan, thanks. I'll look into this for a future update.
Image
Albert Wiersch

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Problems with “replace in all open documents”-command

Post by Albert Wiersch » Fri Feb 05, 2016 4:47 pm

Johan, I'm working on this right now. It should be in the v16.02 update which I plan to release next week. :D
Image
Albert Wiersch

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Problems with “replace in all open documents”-command

Post by Albert Wiersch » Mon Feb 08, 2016 12:24 pm

Johan, I've just released v16.02. You can now hold down the 'Shift' key while selecting 'Save All' to select an encoding (like UTF-8) and use it to resave all opened documents with the selected encoding. Please give it a try and let me know how it works.
Image
Albert Wiersch

Johan Edlund
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 5
Joined: Mon Jan 18, 2016 2:34 pm

Re: Problems with “replace in all open documents”-command

Post by Johan Edlund » Wed Apr 06, 2016 4:30 pm

Hi again!

Sorry for my late response!
When you wrote “in the future” I didn’t think it was only three days!
I tested the new function on a few documents tonight and it works absolutely perfect.
This function will save me many hours of work. :D
Now I can continue convert the rest of my HTML-document (I have 357 documents left to convert!)
Thank you for your help and for a very good program!

Best regards, Johan Edlund

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Problems with “replace in all open documents”-command

Post by Albert Wiersch » Wed Apr 06, 2016 8:12 pm

Johan,

Great! I'm glad it worked perfectly and will save you lots of time. :)
Image
Albert Wiersch

Post Reply