Arabic character is shown separated in C# HTML renderer - utf-8

I am using HTML renderer 1.5.0.6 for wpf available on https://htmlrenderer.codeplex.com/
The problem is Arabic/Persian characters is shown separated, for example this code:
<!doctype html>
<html dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset = utf8" />
</head>
<body>سلام</body>
</html>
is shown like:
س‌ل‌ا‌م

Related

How to add metadescription translation in astro with i18next?

I am trying to translate my meta per page but I get stuck or error there is my code layout.astro
---
import i18next from "i18next";
export interface Props {
title: string;
}
const { title } = Astro.props as Props;
---
<!DOCTYPE html>
<html lang={i18next.language}>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
and there my index.astro
<Layout title={t("pageTitle")} description={t("pageMeta")}>
Any idea Thanks
I am trying to translate my metadescription page by page with i18next in astro.bluid

extending fragments in Thymeleaf

I have the following fragment. I'm trying to extend the base fragment "head" with the open graph tags... but the rendered page contains only tags from fragments/head, with the og ones.
How can I add more tags to a fragment?
<head th:include="fragments/head :: head">
<!-- You can use Open Graph tags -->
<meta property="og:url" th:content="${url}" />
<meta property="og:type" content="website" />
<meta property="og:title" content="GUApp" />
<meta property="og:description" th:content="${description}" />
<!--<meta property="og:image" content="http://www.your-domain.com/path/image.jpg" />-->
</head>
<head th:fragment="head" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
....
</head>
The easiest option is to pass additional tags as in Flexible layouts documentation demo.
Thanks to fragment expressions, we can specify parameters for
fragments that are not texts, numbers, bean objects… but instead
fragments of markup.
This allows us to create our fragments in a way such that they can be
enriched with markup coming from the calling templates, resulting in a
very flexible template layout mechanism.
index.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:include="header :: head(~{::meta})">
<!-- You can use Open Graph tags -->
<meta property="og:url" th:content="${url}"/>
<meta property="og:type" content="website"/>
<meta property="og:title" content="GUApp"/>
<meta property="og:description" th:content="${description}"/>
</head>
...
header.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:fragment="head(meta)">
<!-- some default styles -->
<link href="base.css" rel="stylesheet" />
<!--/* Per-page placeholder for additional meta tags */-->
<th:block th:replace="${meta}" />
</head>
...
Result html:
<!DOCTYPE html>
<html lang="en">
<head>
<link href="base.css" rel="stylesheet" />
<meta property="og:url"/>
<meta property="og:type" content="website"/>
<meta property="og:title" content="GUApp"/>
<meta property="og:description"/>
</head>
...

Basic highlightjs document won't work

Highlightjs has very simple usage instructions, which I can't seem to get to work in the document below. I would expect the html within the <pre> and <code> to be displayed, but all I see is the text. What am I doing wrong?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/styles/default.min.css">
<script src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<pre>
<code class="html">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p>This should be escaped, highlighted html. </p>
</body>
</html>
</code>
</pre>
</body>
</html>
The answer is highlightjs does not escape code for you as was suggested to me. Good link here.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/styles/default.min.css">
<script src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<pre>
<code class="html">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p>This should is highlighted html. </p>
</body>
</html>
</code>
</pre>
</body>
</html>

Code Igniter lose charset

I'm using codeigniter but it loses charset every time.
What can cause this?
For example:
At my address bar
www.abc.com/def
www.abc.com/def/
My db is UTF-8
My config file - $config['charset'] = 'ISO-8859-1';
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
</body>
</html>
take a look at meta charset part

open graph tags not being read by Facebook but are in page source

I'm having a problem getting Facebook to recognize my open graph tags. In looking at the source of the page I see the open graph tags properly but when I go to Facebook's open graph tag debugger, it is not picking up the open graph tags.
Here's what the source looks like:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#">
<head>
<meta charset="UTF-8" />
<title>Run When You - Arte House on Joss & Main</title>
<meta name="description" content="With its' vibrant pastel color scheme and and unique design this wall art sign provides the perfect inspirtation for anytime of the day. Comes complete with ..." />
<meta name="keywords" content="Vintage-Inspired Wood Plank Wall Art" />
<meta property="fb:admins" content="32604531" />
<meta property="og:title" content="I love the Run When You in the Arte House event at Joss & Main!" />
<meta property="og:description" content="With its' vibrant pastel color scheme and and unique design this wall art sign provides the perfect inspirtation for anytime of the day. Comes complete with ..." />
<meta property="og:image" content="https://secure.common.josscdn.com/lf/53/hash/15872/5360609/1/Run+When+You.jpg" />
<meta property="og:site_name" content="Joss & Main" />
<meta property="og:type" content="product" />
<meta property="og:url" content="https://www.jossandmain.com/Run-When-You~QVH1296~E627.html" />
Here's what the Facebook's debuger pickes up:
URL: https://www.jossandmain.com/Run-When-You~QVH1296~E627.html
https://developers.facebook.com/tools/debug/og/object?q=https%3A%2F%2Fwww.jossandmain.com%2FRun-When-You%7EQVH1296%7EE627.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta charset="UTF-8">
<title>Joss & Main</title>
<meta property="fb:admins" content="32604531">
I'm banging my head on the wall - any ideas?
Are you sure the tags are there? Here's what I see in that URL:
Had the same problem changed
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#">
to just
<!DOCTYPE html>
Source:
http://www.thesoftgrounds.com

Resources