html-entities

TinyXML and preserving HTML Entities

孤街醉人 提交于 2019-12-11 06:25:59
问题 I'm using TinyXml to parse some XML that has some HTML Entities embedded in text nodes. I realize that TinyXML is just an XML parser, so I don't expect or even want TinyXML to do anything to the entities. In fact I want it to leave them alone. If I have some XML like this: ... <blah>ü</blah> ... Calling Value() on the TiXmlText instance I get: "uuml;" So TinyXml always seems to remove the ampersand. Is there any way I can get it to leave it alone so it comes out unchanged? Appreciate any

Convert text with unicode to HTML entities

霸气de小男生 提交于 2019-12-11 04:37:31
问题 In VBA , how do you convert text containing Unicode to HTML entities? Eg. Test chars: èéâ👍 would be converted to Test chars: èéâ👍 回答1: In Excel, characters are stored using Unicode UTF-16 . The "Thumbs up" character (👍) corresponds to the Unicode character U+1F44D, encoded as follows: in UTF-16 (hex) : 0xD83D 0xDC4D (d83ddc4d) in UTF-16 (decimal) : 55357 , 56397 The following function (and test procedure) should convert as expected: Sub test() txt = String2Html("Test chars: èéâ" & ChrW(&HD83D

How do I show non-standard characters in the address bar?

左心房为你撑大大i 提交于 2019-12-11 04:07:05
问题 I have a bugging problem. For a website I made there are search engine friendly URL's generated. The only problem is there are ß-chars in the url too. Chars like ö, ï, ä, ü etc. are placed correct. But with the ß-char there is a diamond-icon with a questionmark in it. I thought it had to do with the charset which is used but i've tried both UTF-8 and iso-8859-1. Both without luck. I need to have the correct character in the url for the readability of deeplinks. 回答1: Solved the problem with

HTMLParser misunderstands entities in href. Is it a bug or not? Should I report it?

别等时光非礼了梦想. 提交于 2019-12-11 03:23:57
问题 I don't want to know how to solve the problem, because I have solved it on my own. I'm just asking if it is really a bug and whether and how I should report it. You can find the code and the output below: from html.parser import HTMLParser class MyParser(HTMLParser): def handle_starttag(self, tag, attrs): for at in attrs: if at[0] == 'href': print(at[1]) return super().handle_starttag(tag, attrs) def handle_data(self, data): return super().handle_data(data) def handle_endtag(self, tag):

html entities not converting special characters

旧巷老猫 提交于 2019-12-10 22:18:35
问题 I'm using htmlentities which is converting characteres with accents, but it is not converting this type of quotes “. Instead the browser shows a weird symbol with a question mark � How can I convert these kind of characteres that display as symbols? e.g. The book called �Hello Colors� is on the table. I've tried this commands but it's not working: htmlentities($message); htmlentities($message, ENT_QUOTES, 'UTF-8'); htmlentities($message, ENT_NOQUOTES, 'UTF-8'); htmlentities($message, ENT

How to tell if a string contains HTML entity (like &)?

给你一囗甜甜゛ 提交于 2019-12-10 17:52:14
问题 I'm trying to write a function that checks a parameter against an array of special HTML entities (like the user entered '&amp' instead of '&'), and then add a span around those entered entities. How would I search through the string parameter to find this? Would it be a regex? This is my code thus far: function ampersandKiller(input) { var specialCharacters = ['&', ' '] if($(specialCharacters).contains('&')) { alert('hey') } else { alert('nay') } } Obviously this doesn't work. Does anyone

How to get HTML5 canvas text to show html entity?

半腔热情 提交于 2019-12-10 16:24:08
问题 I'm parsing an xml file that stores image/caption data both of which I need to display on my canvas. However occasionally there's an entity in the file and when drawing the text to the canvas it interprets it as flat text. How can i get © to show up as © on the canvas? Is this even possible, or does anyone know of a good work around? 回答1: You could replace the HTML entities with their equivalent unicode characters. E.g. var x = 'This is © 2010'; x = x.replace( /©/, '\u00A9' ); // x is now

PHP htmlentities not working even with parameters

懵懂的女人 提交于 2019-12-10 13:08:50
问题 Of course this has been asked before and have searched for solutions, all which have not worked thus far. I want to change out the TM symbol and the ampersand to their html equivelents by using htmlentities or htmlspecialchars : $TEST = "Kold Locker™ & other stuff"; echo "ORGINIAL: " . $TEST . "<BR/>"; echo "HTML: " . htmlentities($TEST, ENT_COMPAT, 'UTF-8'); This displays: ORGINIAL: Kold Locker™ & other stuff HTML: I have also tried it with htmlspecialchars and the second parameter changed

What's the difference between Android's Html.escapeHtml and TextUtils.htmlEncode ? When should I use one or the other?

别来无恙 提交于 2019-12-10 12:44:58
问题 Android has two different ways to escape / encode HTML characters / entities in Strings: Html.escapeHtml(String), added in API 16 (Android 4.1). The docs say: Returns an HTML escaped representation of the given plain text. TextUtils.htmlEncode(String) For this one, the docs say: Html-encode the string. Reading the docs, they both seem to do pretty much the same thing, but, when testing them, I get some pretty mysterious (to me) output. Eg. With the input: <p>This is a quote ". This is a euro

Excel macro to convert HTML entities to text

这一生的挚爱 提交于 2019-12-10 10:24:46
问题 I have a huge Excel file that contains the result of an online survey. The person who built the survey messed up the formatting in several respects, and the mess-up I need to take care of first is converting HTML entities to regular text. From what I can see only two HTML entities are used, , and " but the document is over 12,000 rows so I cannot be sure there are no other HTML entities used... and if other HTML entities are used I want them converted to text as well. I have successfully made