Replaced hypen by – in html text - html

why hypen is replaced by – in html text
<div class="left">Additional website – URL</div>
But when loading webpage shows as ' Additional website – URL ' .
I know use of Html code instead of this hypen ,but I want to know how it happens because just above div tag is working correctly
<div class="left">Additional website - Name</div>
Webpage as 'Additional website - Name'

Look into encoding issues. Using a correct header for your site may have an effect on how it is rendered. Could you post your headers?

What you see is an en-dash (not a hyphen!) which is correctly encoded in UTF-8 in the HTML file, but decoded incorrectly by the browser. You must set your browser’s character encoding to UTF-8.

it happened to me with the '–' character (long minus sign).
I used this simple replace so resolve it:
htmlText = htmlText.Replace('–', '-');

Related

excelvba selenium cannot get html address

I have a problem with my html page below. because the page is encrypted; I have uploaded a screenshot.
enter image description here
I want to get the text in the 1st field.unfortunately, it doesn't come apart from the text in the 2nd field.
<div class="col-sm-4" id="anneAdi">
<i class="feather icon-eye-off f-20 bak2" data-id="0" data-bak="anneAdi"></i>
<img src="/Common/bitMapResimGoster.aspx?BitMapResim= : SEVİM"></div>
I want to write SEVİM in excel cell
<'elementler = baglan.FindElementByCss("#anneAdi > img").Attribute("src")>
<'elementler = baglan.FindElementByCss("img").Attribute("src")>
Formula result: %C2%A0:%C2%A0SEV%C4%B0M
like. I tried constantly but it didn't work.
sorry for my broken english.I'm waiting for your help. thanks.
%C2%A0:%C2%A0SEV%C4%B0M If this is your problem, then you know that this is how it is encoded perhaps, because of the empty spaces that are there in the img src: /Common/bitMapResimGoster.aspx?BitMapResim= : SEVİM. Note that there are spaces after BitMapResim, and because of that the output shows like that.
See here
A snippet from W3Schools (https://www.w3schools.com/tags/ref_urlencode.asp)
URL Encoding (Percent Encoding)
URL encoding converts characters into a format that can be transmitted
over the Internet.
URLs can only be sent over the Internet using the ASCII character-set.
Since URLs often contain characters outside the ASCII set, the URL has
to be converted into a valid ASCII format.
URL encoding replaces unsafe ASCII characters with a "%" followed by
two hexadecimal digits.
URLs cannot contain spaces. URL encoding normally replaces a space
with a plus (+) sign or with %20.

How to show the actual code for html entity or html special character code

I want to show the actual code for the html entity on the screen rather than the interpreted character it represents. Like on this page: https://www.w3schools.com/html/html_symbols.asp or another page that describes the html codes.
I want to show & # 3 8 ; (but without spaces between characters) in the webpage rather than the '&'.
Simply escape the ampersand.
&#38;
will display as, literally & when rendered in HTML.
Try following
I will display €
I will display €
I will display €
This may help

How to convert CSS unicode string to text character?

I'm using an icon set that has to be used through an element like this:
<i class="icons-recycle"></i>
This generates an element with the following CSS:
.icons-recycle::before {
content: "\e67f";
}
What I need is to copy/paste the Unicode glyph that's generated via "\e67f" so I can use it in Photoshop to do some designs with that icon (I already have the .ttf file installed).
For example, "\u00C6" gives me Æ, according to this online converter.
However, I am unable to find what that character is, and I cannot select it on the HTML page! How can I convert this "\e67f" to a text character to paste into Photoshop?
MDN says the content attribute, when used like this, is in a Unicode escape sequence.
Easiest way I found was to use the content string to convert to an HTML character entity:
Instead of \e67f, type <div></div> (replace the \ with &#x) and the browser will display the individual glyph .
You can then copy/paste into Photoshop, it should display as expected if you have the proper font installed.

unknown chars %3cb added while creating html file

I'm trying to update a html file. which has following tags
The tune2fs allows you to convert an ext2 file system to
The content is available on online-html editor,when copy-paste(ctrl/c + ctrl+v) the content and add it file, it becomes
he+%3Cb%3Etune2fs%3C%2Fb%3E+allows+you+to+convert+an+%3Cb%3Eext2%3C%2Fb%3E+file+system
does copy/paste adds some chars? Why this happens and is it possible to prevent this?
this is not programming question, but something like copy/paste buffer or creates this issue?
That is HTML that has been URL encoded into <b> and </b> tags. You can change "%3Cb%3E" to "<b>" and "%3C%2Fb%3E" to "</b>". Also note that + is the URL encoded form of " " (space). Alternatively, you could plug it into any URLDecoder and it will decode it for you.

Escape HTML tags and print code to screen

I want the following to be displayed on the screen: < / develop >
However, when I try to place it in my html, it is interpreted as an end tag.
How do I escape regular html tags and write these characters as text to be printed to the screen?
Using HTML Entities:
</developer>
ref: http://www.htmlentities.com/html/entities/
HTML has reserved special characters, so you you use the appropriate HTML entity to emit them to the screen. It can also be useful when you are trying to print out characters outside of the normal ASCII set and you want to be assured they will render correctly irrespective of the browser's character encoding setting.
Like so:
< /develop>