Normally you don't need to worry about encoding single quotes because they don't have a special meaning in HTML, and they can be escaped in most languages. But if you do need to use an entity, your options are ' or '.