Hi,

when parsing web pages I need to figure out the encoding.
What I am currently doing is, getting the start of the page as string buffer.

look for a substring like "charset=iso-8859-1" and then I have the encoding.
The problem is that if that fails:

  encStr = [[NSString alloc] initWithBytes:buffer 
                                    length:len
                                  encoding:NSISOLatin1StringEncoding];

I have no means to get the charset string part.
Before, used to use NSASCIIStringEncoding but that fails for some reason.
What to do if its not Latin1? It could be anything.
It would be fine if all non-ASCI-7 chars would be lost.

Is there a nice way of pushing that cString in and get a lossy (and I mean 
really lossy) ASCII-7 NSString back?
No Iconv or other conversions are needed.

Comments are welcome :-)

David


_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to