html-encode

Make an NSURL with an encoded plus (%2B)

I need to pass a timestamp with a timezone offset in a GET request, e.g., 2009-05-04T11:22:00+01:00 This looks like a two arguments "2009-05-04T11:22:00" and "01:00" to the receiving PHP script (over which I've no control). NSURL doesn't encode plus signs, but if I make an NSURL using the string 2009-05-04T11:22:00%2B01:00 t...

HTML encoded links and anchors

I have a use case where I am setting the page focus to a particular element (having an anchor before it). When a user is not signed in, there is a redirect to the login page and after signing in, the user is redirected to the page in question, with the URL encoded. I see that a URL of the form link#target works as expected (focusing on ...

Regex for Encoded HTML

I'd like to create a regex that will match an opening <a> tag containing an href attribute only: <a href="doesntmatter.com"> It should match the above, but not match when other attributes are added: <a href="doesntmatter.com" onmouseover="alert('Do something evil with Javascript')"> Normally that would be pretty easy, but the HTML ...

Chinese characters in mailto subject line of email

I'm looking to add some Chinese characters in a mailto: email link. I've tried <a href="mailto:[email protected]?subject=调查 / Inquiry">Email</a> but when I click on the link the Outlook subject line shows: 调查亨德森 / Inquiry I've also tried <a href="mailto:[email protected]?subject=&#35843;&#26597; / Inquiry">Email</a>...

HTMLEncode script tags only

I'm working on StackQL.net, which is just a simple web site that allows you to run ad hoc tsql queries on the StackOverflow public dataset. It's ugly (I'm not a graphic designer), but it works. One of the choices I made is that I do not want to html encode the entire contents of post bodies. This way, you see some of the formatting fr...

View webpage in Hebrew language

hi, I have a website with few HTML pages. How can I display them in the Hebrew language? What are the steps that I should follow to ensure it is viewed in different languages for different countries? Thanks ...

SSIS: HTML Encoding a URL in a Script Task

I would like to URL encode a URL in a C# SSIS script task. I have tried using System.Web.HttpServerUtility, but intellisense shows it doesn't seem to be aware of "Server". Here's an example of the code that's raising an error: Import System.Web ... ... ... Server.HtmlEncode(TestVariable); I have worked around this issue by writing a...

Spark view engine automatically applies H() tu ${ ... }

This is part of my spark partial view (it is called TaskSearch): ${ Html.DropDownList("Search.Status", Model.Statuses, "All") } it is generated by non-spark view with code: <% Html.RenderPartial(ControllerActions.TaskSearch, ViewData["TaskSearchModel"]); %> Spark generates view class that contains Output.Write(H( Html.DropDownList...

HTML entity encoding (convert '<' to '&lt;') on iPhone in objective-c

I'm developing an application for the iPhone that has inApp-mail sending capabilities. So far so good, but now I want to avoid html-injections as some parts of the mail are user-generated texts. Basically I search for something like this: // inits NSString *sourceString = [NSString stringWithString:@"Hello world! Grüße dich Welt <-- Th...

Best way to find illegal characters in a bunch of ISO-889-1 web pages?

I have a bunch of html files in a site that were created in the year 2000 and have been maintained to this day. We've recently began an effort to replace illegal characters with their html entities. Going page to page looking for copyright symbols and trademark tags seems like quite a chore. Do any of you know of an app that will take a ...

HtmlSpecialChars equivalent in Javascript?

Apparently, this is harder to find than I thought it would be. And it even is so simple... Is there a function equivalent to PHP's htmlspecialchars built into Javascript? I know it's fairly easy to implement that yourself, but using a built-in function, if available, is just nicer. For those unfamiliar with PHP, htmlspecialchars transl...

Cannot show the downloaded webpage with proper encoding using PHP

I have to get the content of a persian page and show a part of that page to some users. The problem is after I filter the page content I cannot show the content with the proper encoding. The webpage is located at sena.ir and here is the screen shot of the original webpage part I want to show: And here is what I got: Here is the fun...

NHibernate: Should I encode inputs?

I use NHibernate to persist my objects.. However, I cannot seem to find any information about whether I need to encode inputs? For example: string firstName = TextboxFirstName.Text; string lastName = TextboxLastName.Text; using(ISession session = sessionFactory.OpenSession()) { Customer customer = new Customer(firstName, lastName)...

How to stop Spark View Engine HTML encoding?

Even with the following in spark section of web.config: <pages automaticEncoding="false"> Things between ${...} Still get passed through H(...), which HTML encodes it. How change this or should I just fall back to !{...}? ...

php htmlentities to decode textarea

Hi, I have a text area and I would like to take the input of the text area and merge it all together. Everything works fine except that it's escaping the quotes. For example test's is outputted as test/'s To fix this I tried htmlenttries such as, <?php $inputtext= $_POST['textinput']; $encodetext = htmlentities($inputtext); ...

What's the correct way to get HTML from an AJAX Response in JSON Format?

Hi all, I have an AJAX request that creates a 'post', and upon successful post, I want to get HTML to inject back into the DOM. Right now I'm returning a JSON array that details success/error, and when I have a success I also include the HTML for the post in the response. So, I parse the response as JSON, and set a key in the JSON array...

How can I encode a string for HTML?

Looking for a simple way to HTML encode a string/object in perl. the least amount of additional packages used the better. ...

line break within Html.Encode & String.Join

I have the following line of code. <%= Html.Encode(string.Join(", ", item.company1.companies.Select(x => x.company_name).ToArray())) %> Would it be possible to somehow replace the comma with a line break? ...

How to html encode the output of an MVC view?

I am building a web app which will generate lots of different code templates (HTML tables, XML documents, SQL scripts) that I want to render on screen as encoded HTML so that people can copy and paste those templates. I would like to be able to use asp.net mvc views to generate the code for these templates (rather than, say, using a Str...

How to escape charaters in the title of a marker in a Google Maps?

Say I have this piece of code: var marker = new google.maps.Marker({ position: location, title: 'B&#250;fals', map: map }); This creates a marker as expected but if I hover the mouse over it I don’t see 'Búfals' as I would expect (instead I see the html code). This doesn't make any difference: var marker = new google.m...