html-encode

HTML encoding and decoding

Hi All, I am looking for a HTML editor, and I found many links through google like this http://online-html-editor.org/ Now I have written something on it: Let say the below content <div> <span style="font-weight: bold; font-size: 12pt; "> Heading</span></div> <div><br /> <...

Is there a built-in jQuery function for encoding a string as HTML?

Is there a built-in jQuery function for encoding a string as HTML? I'm trying to take the text a user types into a text box and then put that text into a different area of the page. My plan was to take the .val() from the text box and supply that to the .html() of the <div> element. Perhaps there's a good jQuery plugin to help with th...

Do you use <%: %> or <%= %> for html helpers in ASP.NET MVC 2.0?

I know they now have this in ASP.NET MVC 2.0 <%: Model.CustomerName %> So when you make HTML helpers is it better to use this way now (provided that you do not want to do HTML encoding)? ...

ASP.NET/.NET: Method to determine whether string is or contains HTML entity

Is there a method anywhere in the .NET framework or System.Web that will tell me whether a string contains an HTML or is one? Should I just Server.HtmlEncode(myString) and see if its length is longer than myString's length before encoding? ...

<%: %> brackets for HTML Encoding in ASP.NET 4.0

Accidentally I found this post about a new feature in ASP.NET 4.0: Expressions enclosed in these new brackets <%: Content %> should be rendered as HTML encoded. I've tried this within a databound label in a FormView like so: <asp:Label ID="MyLabel" runat="server" Text='<%: Eval("MyTextProperty") %>' /> But it doesn't work: The text ...

HTML Encoding Server side vs Client side

I want to enable comment posting on my page, so i need to execute some html encoding before post is sent and inserted into a database. What is the ideal side for this? Sever side(I work with asp.net) or client side (javascript)? ...

How do I XML-encode a string in Erlang?

I have a erlang string which may contain characters like & " < and so on: 1> Unenc = "string & \"stuff\" <". ok Is there a Erlang function somewhere that parses the string and encodes all the needed HTML/XML entities, such as: 2> Enc = xmlencode(Unenc). "string &amp; &quot;stuff&quot; &lt;". ? My use case is for relatively short s...

Is it possible to turn on HTML encoding by default in ASP.NET 4?

In ASP.NET 4, we can use the new <%: ... %> operator to output HTML encoded strings. Is it possible to configure ASP.NET 4 (in web.config) so that the <%= ... %> operator will also HTML encode strings? ...

Asp.net MVC Markdown editor and Html.Encode

I might be mis-understanding here but from my understanding a markdown editor strips out all html. After then using a markdown.Transform() type of method this database stored markdown is converted into html with h1, p etc. With asp.net MVC the general rule is Html.Encode everything. But does this still apply when using a Markdown edit...

PHP html decoding help - converting: A &#039;quote&#039; is <b>bold</b>

I need to convert a string like this: A &#039;quote&#039; is <b>bold</b> into: A 'quote' is <b>bold</b> html_entity_decode() did not work. ...

installing fonts in client machine

I'm building a website(PHP) with chinese fonts. The problem is most browsers doesn't have chinese fonts installed by default. I want the client machine to have this font installed to view the webpage. How can I do this? Edit: I've partially solved the problem with this website : http://www.font2web.com/ it works in IE and FF but not ...

Content type vs HTML encoding

Hello! I'm bulding a site and I've set its content type to use charset UTF-8. I'm also using HTML encoding for the special characters, ie: instead of having á I've got &aacute;. Now I wonder (still bulding the site) if it was really necesary to do both things. Looking for the answer I found this: http://www.w3.org/International/questi...

How do you handle line breaks in HTML Encoded MVC view?

I am unsure of the best way to handle this. In my index view I display a message that is contained in TempData["message"]. This allows me to display certain error or informational messages to the user when coming from another action (for example, if a user tries to enter the Edit action when they don't have access, it kicks them back t...

Transmitting newline character "\n"

Given the following URL (working, try it!) https://select-test.wp3.rbsworldpay.com/wcc/purchase?instId=151711&amp;cartId=28524&amp;currency=GBP&amp;amount=1401.49&amp;testMode=100&amp;name=Tom%20Gul&amp;address=24%20House%20Road\nSome Place\nCounty&postcode=TR33%20999&[email protected]&country=GB If you click on the link and g...

Is there any need to use Html.Encode for an internal site?

I'm having some problems with Html.Encode and users wanting to use special characters. Firstly the characters are replaced by the html codes and so are not displayed properly. And then, if the text is later edited and re-submitted, an exception is thrown when these html codes are re-submitted. Given that this is an intranet site and the...