Problems with “replace in all open documents”-command

For technical support and bug reports for all editions of CSS HTML Validator, including htmlval for Linux and Mac.
Johan Edlund
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 »

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
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

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

Post by Albert Wiersch »

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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
Johan Edlund
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 »

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
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

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

Post by Albert Wiersch »

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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

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

Post by Albert Wiersch »

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?
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
Johan Edlund
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 »

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
Posts: 5
Joined: Mon Jan 18, 2016 2:34 pm

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

Post by Johan Edlund »

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
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

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

Post by Albert Wiersch »

Hi Johan, thanks. I'll look into this for a future update.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

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

Post by Albert Wiersch »

Johan, I'm working on this right now. It should be in the v16.02 update which I plan to release next week. :D
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

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

Post by Albert Wiersch »

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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
Johan Edlund
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 »

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
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

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

Post by Albert Wiersch »

Johan,

Great! I'm glad it worked perfectly and will save you lots of time. :)
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial