[SOLVED] Re: escape special characters in HTML
[SOLVED] Re: escape special characters in HTML
- Subject: [SOLVED] Re: escape special characters in HTML
- From: Dominik Pich <email@hidden>
- Date: Thu, 16 Nov 2006 14:55:19 +0100
Partly helped me.. still:
to not break the markup I use CFXMLCreateStringByEscapingEntities
Now here is where cocoa comes in:
Im using code to generate html and save it to disk.
Further a NSTextView is bound to the path to the file and displays it.
As I saved UTF8 and NSTextView is UTF8 (as is all cocoa?) I assumed
it should automaticly try to see it as UTF8 if not specified
differently. I included a <meta http-equiv> tag and set the charset
to UTF8 now!
Regards,
Dominik
Am Nov 16, 2006 um 2:36 PM schrieb Sherm Pendley:
On Nov 16, 2006, at 8:11 AM, Dominik Pich wrote:
I have the Problem of not being able to encode Special character
like for ex. the German ü or ä in HTML... Id need to escape them
as ü or ä IIRC....
You only need to use the character entities if you're using a text
encoding that doesn't support those characters natively, such as
ASCII.
Surely there is an easy way of doing that?
Yes, there is - don't do it at all. :-)
Just include the characters directly in your HTML, and save it
using an encoding that supports them, such as ISO-8859-1 or UTF-8.
You'll also want to configure your web server to return the correct
Content-type charset - for example:
Content-type: text/html; charset=ISO-8859-1
So, what was your Cocoa question?
sherm--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden