Save as UTF-8 + doctype html ?

26 views
Skip to first unread message

Omar KN

unread,
Dec 9, 2021, 4:13:46 AM12/9/21
to BBEdit Talk

On our website, there are a couple of old files with

HTML 4.01 Transitional or even without any HTML definition


BBEdit Error message:

This document contains characters that could not be represented in the doc's encoding.

and

BBEdit prompts me to just "Save (them) as UTF-8"


My question:

While doing this (saving as UTF-8) is it better ALSO to add 

<!doctype html>

and maybe

<meta charset="utf-8">

/

with best regards, Omar KN,  Stockholm, Sweden


Gerald Davenport

unread,
Dec 12, 2021, 2:22:34 PM12/12/21
to bbe...@googlegroups.com
YES. in a nut shell

all my websites i create and manage i start with php variables, yes my sites are php so i can use variables, includes, and such, kind of my own wordpress kind of setup.

anyway.

it starts with

<!DOCTYPE html>
<html lang="en-US”> (use your preferred language, or dynamically change it depending on the user)

<head>
i then call a file to that adds the following code:

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />

I read several technical places that these should be, or they are much better, if they are put above the title tag.

reason i call the file to add the code instead of pitting the code in the index file is it is a standard file i can add to each site and call with one line and makes the index.php file easier to read and view. and if it is a component that is used on all pages, i made it, as some will call it, an include/widget/ or what ever.

it is what i do and have done for many many years.

i have seen pages work without the doctype and language tags. but that does not mean that google, bing, or other search engines like it and give you precedence over others sites that do have it.

my thoughts are, if it is going to help you even a little and not hurt, why not do it?

if it COULD hurt your rankings or the way the page is displayed across browsers and devices, why do it?

I research weekly on the proper formatting, layout, tags, and anything i can to make my clients site rank higher (organic searches), view perfectly in all devices and browsers, and load fast on mobile devices and desktops as the available resources allow me. And with VERY LITTLE Javascript. no wordpress security issues or bloated code. I control every aspect of WCAG, SEO, layout, loading issues, and such by hand. yes, it may take me a little longer to maintain and create, but it is the best way and the correct way.

- gerald
multimedia specialist

--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/c6ac4acb-4f52-44ab-9977-e928ed3a0db8n%40googlegroups.com.


Byers Home Page

11773 Slow Poke Lane, Grass Valley, California 95945
Byers is committed to protecting your health and safety with a Virtual Consultation.

Reviews on Google • Give Us Feedback

We are here to help you Stay Safe!

Reply all
Reply to author
Forward
0 new messages