[iPhone] Any built in way to convert HTML entities to Unicode?

I have a string with contents something like:
"© 2008"
Is there some method that I can't seem to find that will convert this to:
"© 2008"
Basically is there something built in to convert all of the '&xxx;' HTML entities to their Unicode counterpart? I can write my own code to do it but I want to check here first.
Thanks.

I had the same problem and did only find a semi built in solution using NSXMLParser
@interface MREntitiesConverter : NSObject {
NSMutableString* resultString;
@property (nonatomic, retain) NSMutableString* resultString;
- (NSString)convertEntiesInString:(NSString)s;
@end
@implementation MREntitiesConverter
@synthesize resultString;
- (id)init
if([super init]) {
resultString = [[NSMutableString alloc] init];
return self;
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)s {
[self.resultString appendString:s];
- (NSString)convertEntiesInString:(NSString)s {
if(s == nil) {
NSLog(@"ERROR : Parameter string is nil");
NSString* xmlStr = [NSString stringWithFormat:@"<d>%@</d>", s];
NSData *data = [xmlStr dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
NSXMLParser* xmlParse = [[NSXMLParser alloc] initWithData:data];
[xmlParse setDelegate:self];
[xmlParse parse];
NSString* returnStr = [[NSString alloc] initWithFormat:@"%@",resultString];
return returnStr;
- (void)dealloc {
[resultString release];
[super dealloc];
@end
In Cocoa (Core Foundation) there is
NSString* sI = (NSString*)CFXMLCreateStringByUnescapingEntities(NULL, (CFStringRef)s, NULL);
but that does not (yet?) exist on the IPhone (2.01)

Similar Messages

  • Converting HTML Escaping to Unicode Escaping characters in Java

    Hi,
    I am getting some HTML escaping for special characters like pound, space, dollar etc. from database in HTML escaping format as  &apos; &pound;      &reg; etc.which I want to convert their Unicode equivalent escaping as U00A3,U0026. Java only convert & to & (U0026) but rest of the characters are not getting converted. If there is any API or way to do this please reply.
    Note : I cant change Database as there are already thousands of records & My front end only needs Java to do all these conversions I cant change that also.

    I have posted a method that does what you want. It was a long time ago since I wrote it and you should probably use a StringBuilder instead of a StringBuffer if you are going to use it in Java 5 or later. You can find the method in this thread:
    http://forum.java.sun.com/thread.jspa?threadID=652630

  • IPhone: Any officially supported way to efficiently render bitmaps?

    I'm trying to render animated bitmapped graphics. Some of them are RGB565, some are ARGB8888, and they need to be displayed at 30 fps. Now, so far the only documented way I found to do it is to create a new CGImage every frame, but this involves two memory copy operations on the whole bitmap, plus potentially unnecessary color format conversion. Now, I'm aware of private system frameworks like CoreSurface, but I would rather avoid unsupported APIs. Anybody has a better way to do something like this in a supported way?

    1) No glClear needed if you're covering the whole screen. (I don't cover the whole screen, so I do need it, also I need it to clear the depth buffer).
    2) What I mean is if you modify GL state, don't bother querying it beforehand, saving it (in a local variable or wherever) and restoring it once you've drawn. GL state queries are expensive on PowerVR's implementation. Sounds like you're doing the right thing.
    3) glTexParami(GLUNPACKALIGNMENT) sets the memory alignment of texture rows. In general, you want it to be 4 (bytes) so that texture uploads can be done using whole-register fetches and puts. 4 is the default, so unless you've changed it, no need to worry. See man glTexParami.
    5) Yep.
    One other thing.. if you're drawing in landscape mode, the iPhone OS Programming guide tells you to not transform the CAEAGLLayer, but to just draw your content rotated. This is also important. I'm drawing landscape, i.e. use glViewport(0.0, 360, 0.0, 480) and this sequence when setting up the camera:
    glMatrixMode(GL_PERSPECTIVE);
    glLoadIdentity;
    glRotatef(-90.0f, 0.0f, 0.0f, 1.0f);
    glOrthof(0.0f, (float)w, 0.0f, float(h), -1.0f, 1.0f));
    Cheers,
    Phil.
    where w=480, h=360.

  • Convert HTML table to JTable

    do you have any way to convert HTML table ( in HTML file) to JTable?
    Thanks in advance.

    Not that I'm aware, and I doubt you'll find built-in support for it any time soon. HTML "tables" and Java "tables" are two very different things. HTML table data is inlined whereas JTables are strictly an MVC design. HTML table data is static whereas JTable data needn't be; the same can be said for the layout, column widths, and column positions.
    It would not be impossible to create a simple parser which read a basic HTML table element and generated a JTable/TableModel based on that information; the amount of work involved would be affected, of course, by the number of HTML table features you'd want to support.
    What precisely motivates you to do this? Are you trying to create a Java web browser?

  • Converting html file to csv file or excel file

    Any body help me to convert html file into csv file or excel file using java.
    I have no idea how to proceed.
    is there any third party API's available.
    Please guide me.
    Thanks in advance
    Vivek

    dev_vivek wrote:
    I have no idea how to proceed.That could be due to the fact that there is no generic way to transform a html file into a csv or excel file.
    Could it be that you're really interested in extracting specific values from the html file and then you want to export these values to csv and/or excel?

  • Convert html into tidy html to convert pdf using iText

    hello.
    I am try to convert html document into pdf.
    first i tried iText it works properly. but it needs all the tags to be witten correctly.
    when u try html not well formeted it gives an exception.
    So is there any way to convert html to pdf.
    or if not if not then way to convert html into properly taged HTML
    so it s easy to convert it to html,
    If you have any working example of Tidy.jar please send me.
    Thanks..

    Hi,
    I had a similar tasko to do i.e converting HTML to PDF.
    Please follow the link to this site and download the trial code.
    http://www.pd4ml.com
    I was able to convert my HTML to PDF.
    Have a look at it and let me know.
    Regards,
    Joe

  • Convert HTML special characters to String

    Hi,
    I'm looking for an easy way to convert HTML special characters (like "&#246") to String.
    Any Ideas how implement this? Thanks

    Hi,
    I'm looking for an easy way to convert HTML special
    characters (like "�") to String.
    Any Ideas how implement this? Thankswell im assuming that you mean that when you are working with java you will be getting a ? instead of the character you want. assuming that you are reading and writing to this html file. if not well maybe this can stil help : BufferedReader inFile = new BufferedReader(new InputStreamReader(new FileInputStream(fileName),"ISO8859-1"));
    PrintWriter outFile = new PrintWriter(new OutputStreamWriter(new FileOutputStream(fileName2), "ISO8859-1")); basically you need to make sure that ou define ISO8859-1 as the encoding.

  • Is there any built in program

    is there any built in program to convert a wmv to a readable format? If there isn't is there a way I can do I with apple script

    Not built-in, since WMV is a proprietary format. VLC is a free player, and Flip4Mac is a free QuickTime plugin that handles WMV.

  • I have the iphone 4s and i received a video but its in slow motion now is there any way to convert the slow motion to regular speed with my 4s

    i have the iphone 4s and i received a video but its in slow motion now is there any way to convert the slow motion to regular speed with my 4s

    Only your service provider can unlock the phone. Check with the provided.

  • Any way to convert PDF document in to Tiff format with inbuilt IBR features

    Is there any way to convert PDF document in to Tiff format with inbuilt IBR features?
    In our Webcenter Portal app, we create the PDF document with the content of ADF pages and check it in UCM using RIDC api.
    There will some batch job which will retrieve the documents from UCM and send them to client internal Document management system. The client / batch job will only process TIFF files. So we need a way to convert the PDF into TIFF. We are okie to have both PDF and TIFF stored in UCM.
    When i have done research, i could only see components like PDFexport or TIFFConverter which only converts the other formats into PDF. But i am expecting a reverse conversion. Is it possible ? Thanks

    949767 wrote:
    Is there any way to convert PDF document in to Tiff format with inbuilt IBR features?
    In our Webcenter Portal app, we create the PDF document with the content of ADF pages and check it in UCM using RIDC api.
    There will some batch job which will retrieve the documents from UCM and send them to client internal Document management system. The client / batch job will only process TIFF files. So we need a way to convert the PDF into TIFF. We are okie to have both PDF and TIFF stored in UCM.
    When i have done research, i could only see components like PDFexport or TIFFConverter which only converts the other formats into PDF. But i am expecting a reverse conversion. Is it possible ? ThanksYa actually I got a tool that could [convert pdf | http://www.allbestapp.com/products/pdf-converter.html] to other formats, including jpg and tiff. that may fit your need.
    You could take a shot through the link above.
    Edited by: user13548958 on 2012-8-23 上午10:49
    Edited by: user13548958 on 2012-8-23 上午10:52

  • Any way to convert CLOB to string in DB2?

    I'm trying to provide report names in audit reports.
    Is there any way to convert CLOB (AUDIT_DETAL.DETAIL_TEXT) to string?
    We use BO XI R3 on DB2 v.9.
    Thank you.

    949767 wrote:
    Is there any way to convert PDF document in to Tiff format with inbuilt IBR features?
    In our Webcenter Portal app, we create the PDF document with the content of ADF pages and check it in UCM using RIDC api.
    There will some batch job which will retrieve the documents from UCM and send them to client internal Document management system. The client / batch job will only process TIFF files. So we need a way to convert the PDF into TIFF. We are okie to have both PDF and TIFF stored in UCM.
    When i have done research, i could only see components like PDFexport or TIFFConverter which only converts the other formats into PDF. But i am expecting a reverse conversion. Is it possible ? ThanksYa actually I got a tool that could [convert pdf | http://www.allbestapp.com/products/pdf-converter.html] to other formats, including jpg and tiff. that may fit your need.
    You could take a shot through the link above.
    Edited by: user13548958 on 2012-8-23 上午10:49
    Edited by: user13548958 on 2012-8-23 上午10:52

  • Best way to convert iPhone app to widget?

    hiya
    was wondering if there is a way to convert an iPhone app to a widget
    if not.. what is best approach?
    TIA

    yeah, apple should release the simulator for general consumption.

  • I would like to restore my iphone to ios 4.3.5 from 5.0.1. i've tried and watched videos over youtube  and it doesn't helps. is there any other specific way? the ios 5.0.1 makes my phone crash and drains my battery whenever i tried to switch it back on.

    i would like to restore my iphone to ios 4.3.5 from 5.0.1. i've tried and watched videos over youtube  and it doesn't helps. is there any other specific way? the ios 5.0.1 makes my phone crash and drains my battery whenever i tried to switch it back on. kindly help me.

    There is no legit way to do this at all.

  • Using Muse, I was wondering if there is a way to convert a website that is already built into a mobile website.

    Using Muse, I was wondering if there is a way to convert a website that is already built into a mobile website. I have no idea how the website was originally built. My client is asking me to build a mobile site for his current site without touching his desktop site. His site was originally built in Dreamweaver I think but he have no way of finding the files and lost contact with his original designer. We don't want to start a new site from scratch with a new domain because he is afraid of losing his seo work.
    In other words. My client site was build in Dreamweaver or something else. I am not a programer and was going to use muse to make his mobile site. So the question is how do I link a muse made mobile site to his desktop site?
    Thank you.

        as62467 We appreciate your G3 question! Let's see how we can help. What you are able to adjust is the USB connection mode by going to the home screen and selecting'recent apps' (in the touch keys bar), settings,storage, the menu (the 3 tiny dots) and tap usb pc connection. If you do not want the software to try and install choose either the internet connection or camera option. Let us know if this helps.
    SheritaH_VZW
    Follow us on Twitter

  • Any Way to display HTML pages on Applet

    Hi All,
    Is there any way to show web pages on Applet?
    Is it possible ?

    I am not aware of a simple way to display HTML in an applet. However, I have used the JEditorPane to display HTML documents. Handling links, etc. with this component requires some effort. Also requires Swing.
    Have you considered using the applet to display a page on the browser. (i.e. getAppletContext().showDocument(URL, [frame name]))? Just an idea.
    Good luck.

Maybe you are looking for

  • Answer these questions on Basic ABAP?

    hi all,    answer the following, 1)BAPI does not include   a)import   b)user dialogue   c)export   d)exception 2)when will the TOP_OF_PAGE event will be triggered?   a) when report starts   b)when first write statement is executed   c)when TOP_OF_PAG

  • How to convert oracle report in html form into excel form?

    Hi friends !! I m trying to convert oracle 10g report into excel form.Its coming in excel form but not with all formats.How to solve the problem?

  • Using ipod on Estima TV

    I have an imported Toyota Estima with a factory fitted DVD/TV player in it (the type in the dashboard and with a screen that hangs down in the middle of the vehicle). In the very back there is a VTR connection and I have tried plugging my ipod video

  • Documentation of the FDS metadata tag

    Can anyone direct me to detailed documentation of the <metadata> tag used in an FDS destination?

  • Failed to save xsl map

    I see a few people asked about this problem. do you have a solution yet? I tried to use Transform Activity in BPEL 10.1.3 Developers Preview. I am not able to create any transformation. It keeps giving me this error: "Failed to save XSL map. Make sur