I need an iOS tool to encode HTML? - html

I am parsing some XML that will have a link such as the following one in it:
http://sale.images.woot.com/Château_de_Brigue_French_RoséhknStandard.jpg
As you can see this link has accented characters in it. iOS has trouble with this an will not load the image given the link in that form. If I go to Google Chrome and navigate to that image, and copy the link in the address bar, I can see that it has encoded the accented characters as follows:
http://sale.images.woot.com/Ch%C3%A2teau_de_Brigue_French_Ros%C3%A9hknStandard.jpg
However, this doesn't make any sense to me because if I go to W3C's URL Encoding Reference, and swap out the accented characters in the link with the numbers in their ASCII chart, it seems like the link should be
http://sale.images.woot.com/Ch%E2teau_de_Brigue_French_Ros%E9hknStandard.jpg
but this does not work- in my browser or loading into an image view in iOS.
Could someone please explain what's going on? Thanks :)
Also, if someone knows an easy way to encode URLs in iOS that would be great.

EDIT: If you copy and paste the é character from the w3schools website into their URL encoding tool, it will come back as %C3%A9. My previous answer here claimed that they were different characters, but I was wrong. It basically just looks like the table on that page is wrong. In any event, the iOS functions described in this page should give you a good answer to what you need to do for your project.

Use of this methods may help you
escape()
encodeURI()
encodeURIComponent()

Related

How do I get rid of this character ?

This character:

shows up on my site 3 times and for all 3 cases it's shown after a closed div tag. I searched the web and SOF and there are some solutions but none of them worked on mine so decided to post here. I am using .NET. I realize that this is not sufficient info but i am new to programming so not sure what other info you might need. Please let me know. Thanks!
Looks like an byte order mark. Please check your source and output encoding.
Yes it is the Byte Order Mark (BOM). It was driving me crazy too. I researched and started reading about BOM and tried adding charset="UTF-8" to some script tags but no go.
I use Dreamweaver and found that when I saved (save as) some recent html files, the option for "Include Unicode Signature (BOM) was checked. I unchecked and saved and it resolved the unwanted characters (I guess it saves it without the BOM)!!
Updating the meta tags charset to UTF-8 will resolve this too and is recommended (which means dozens of pages for me) but I needed this quick fix.
Also, saving with notepad++ looks to do the trick as well. Here's a related article wrt ++ and settings wrt BOM: notepad++ converting ansi encoded file to utf-8
I hope this help someone!
I use Dreamweaver and found that when I saved (save as) some recent html files, the option for "Include Unicode Signature (BOM) was checked. I unchecked and saved and it resolved the unwanted characters (I guess it saves it without the BOM)!!
This is the perfect solution. its worked for me.
thx everyone

Words showing differently in the browsers

I am working on a site which has some Norwegian words. When I used "På" inside a <span> it is showing as "PÃ¥" in the browser.This is happening only for a particular page. For others it is working fine.I have tried to copy-paste from other working pages.But had no effect.It is showing "PÃ¥" instead of "På".Why this is happening?
you need to use &aring insead of å
see this link for html codes-
http://www.ascii.cl/htmlcodes.htm
Try converting your special characters to equivalent HTML entities using this converter
The character encoding of the page is wrong: the real encoding differs from the declared encoding. Using entity references for all non-Ascii characters would hide the symptoms (with the pertaining risk that later on, when someone inserts an “å”, things go wrong again). But the solution is to remove the conflict.
Check out the tutorial Declaring character encodings in HTML. If you need further help with this, posting the URL (not just copy of all code) is essential.

Rendering barcodes in HTML with Code 128 font

Is it possible to render correct bar-codes in HTML using the Code 128 font?
The main content of the bar-code is fine in the broswer (firefox) but when I try to add the start code character I just get this character in the browser:
Ñ
This is ASCII code 209. I'm wondering if it even has a bar representation.
I'm using MVC but this is really just a HTML/CSS problem I think.
Thanks
This isn't quite what you asked for, but you can make barcodes using CSS: see http://unixshell.jcomeau.com/src/barcodes/memberships.html. I'm using code39 for this, but most other linear codes can be done the same way.
Are you sure that the client is going to have barcode font installed?
Server side image generation seems to be a better solution.
You may want to try Barcode.dll for barcode rendering.
It includes ASP.NET barcode control - just drag & drop.
Please note that this is a commercial product I developed.
I know this is years too late, but looking again at the question, I'm pretty sure you're just not using the right numeric code for your font. there is no single "Code 128 font". while 209 is shown by Wikipedia to be the correct "common" code for Start B, in various fonts I found online this is not the case. in this, Start B is 236; and here it's 204. use the right code for your particular font, and you should get what you want.
a code point not encoded by the barcode font will be rendered by a default font, which is why you're seeting the N tilde character.

Special HTML Characters

Ok, so I want to have the characters from below in my html page. Seems easy, except I can't find the HTML encoding for them.
Note: I would like to do this without having sized elements, plain ol' text would be fine ^_^.
Cheers.
You can see that they have a unicode number of the selected character - at the bottom of the picture ("U+266A: Eighth Note").
Simply use the last portion in a unicode character entity: ♪ - ♪
If your page is already UTF-8, you can simply paste it in.
Try encoding it as █ - that should do the trick!
In a UTF-8 encoded page, just copy and paste them as-is.
Otherwise, use the number that the dialog gives you for each character, e.g. ♪
However, when working with rather exotic characters, be very wary of font support. See e.g. this question for background: Unicode support in Web standard fonts
This page gives some information about support for the characters you want to use. They seem to be relatively well supported, but a test on Linux and Mac machines won't hurt.
Here is one comprehensive entity reference. If you want to convert symbols into their entity counterparts, I suggest using this converter.
My suggestion is to use hexadecimal reference. ( it's easy dont worry :) )
for example, the first character you have highlighted in red got ascii value of 175, which is AF in hex.
So in short you can encode it using %AF, and so on...
is it clear mate? Let me know if you need further explanation or help about this :)
Edit: my post is meant for url encoding.

What are the HTML entities for up and down triangles?

I've found the outlined versions, but I want the solid up and down triangles.
Does anyone know these entities?
All named HTML entities are specified in chapter 24 of the HTML standard. The only thing missing from the page are rendered entities, but you can easily create your own copy with the additional information by applying a simple regexp:
s/<!ENTITY (\S+)/<!ENTITY \1 &\1;/
Not all entities are named. For many, you need to specify the Unicode code page, either in decimal (▲ ▲, ▼ ▼) or hex (▲ ▲, ▼ ▼).
A little but late, but you can use &blacktriangledown; &blacktriangledown;, and &blacktriangle; &blacktriangle;, to make both the up and down filled in triangles. I was looking for it myself and the alt codes didn't help so I decided to share this. This same thing works for both left and right as well.
I don't know if I've ever seen what you're looking for. Maybe a better way of doing it would be to create the arrows in Photoshop on a transparent background (.gif or .png format), and then load up the images.
Check that, you can do it through alt characters.
http://www.tedmontgomery.com/tutorial/ALTchrc.html
▼ ▲
using the alt characaters on your computer keyboard is a big no no if you are working on a web page for many reasons. #1. encoding of the website, encoding of the database driving the website if any, the codepage of the computer view the website, the codepage your own pc's keyboard is set to.. all that are mostly factors you can not control. So some people will see wonky weird letter combos or sqiggle characters instead of what you intend. For webpages use the html codes for those characters when ever you can. or at least entity encode and make sure you have your code page defined in your html header of your site.. that way people will see what you intend them to.
now if you are doing this in word for a document that will be viewed in your own country you are probably safe. But for online things (site coding or data entry) you should avoid this like the plague.