How to decode a base64 image that is parsed from an xml

Hi everyone,
I'm trying to decode a base64 image that is parsed from an XML. I was able to decode everything except for an image, and it resulted in weird characters such as
������?��������?��������f����������?
I used sun.misc.BASE64Decoder()
Thanks in advance,
Squid

Hi,
I know that those are wierd characters because I have the correctly decoded data, and it looks different. Does any one know how to decode against the ASCII
I know the following code would decode my base64 image correctly, but i dont know how to do the same in java for the follwing C# line of code:
System.Web.HttpUtility.UrlDecode(sXMLString,
System.Text.Encoding.GetEncoding(1252));
Below is the entire C# code that successfully decode the base64 image from " test9.xml"
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using System.Web;
namespace DecodeXML
class Program
static void Main(string[] args)
string sFileName = "test9.xml";
string sXMLString = File.ReadAllText(@"C:\NET 2.0 Projects\ThrowAways\SampleLabels\" + sFileName);
string resultString =
System.Web.HttpUtility.UrlDecode(sXMLString,
System.Text.Encoding.GetEncoding(1252));
XmlDocument oXML = new XmlDocument();
oXML.LoadXml(resultString);
XmlNode oLabel = oXML.SelectSingleNode("//LabelBody");
// removed the line that saved it to a string variable, because it converts the binary characters to
// incorrect text representations. However, by saving the bytes directly rectifies this
File.WriteAllBytes(@"C:\NET 2.0 Projects\ThrowAways\SampleLabels\" + sFileName + ".txt", Convert.FromBase64String(oLabel.InnerText));
Any suggestion is strongly appreciated.
Thanks,
Squid

Similar Messages

  • How do you save an image that was downloaded from an email into pages to my album?

    I had a friend email me a word document with images in it. The document was downloaded onto my iPad and opened in the pages app. I would now like to save the images from this document into my album so I can use them in other applications. I know how to save from the internet but cant get those save image options when I click on the image in pages. Also had a friend send a powerpoint that downloaded in pages. Would like to use images from that file as well. Help please!

    I am taking a guess here. The photo does not actually reside on the iPad or in the document itself, so you can't save it to the camera roll. You are just seeing the image on the screen. It may even print, but the photo itself is not on the device, so you can't save it.
    Ask him to email the photo itself.

  • I am using an Macbook pro in conjunction with a Time Capsule. I back up all my aperture librarys on it, but how can i view these images that are stored on the capsule please ??

    I am using an Macbook pro in conjunction with a Time Capsule. I back up all my aperture librarys on it, but how can i view these images that are stored on the capsule please ??

    If you want to see what is in a file that is backed up by time machine then you have to restore the entire file. Having said that I have had good experience with Time Machine and individual files... if the file is there then all of it's components are almost for sure there. A way to get around this in Aperture would be to use referenced images. The images then still exist as individual files and can be backed up and restored individually. You would have to do so on a file by file basis though and your album information would still only be saved within the Aperture library.

  • I have an image that I removed from its back ground and I would like to scale the bottom portion of the image because its to wide but not have that effect the top portion of the image which is the correct with. but also keep the aspect ratio correct? how

    I have an image that I removed from its back ground and I would like to scale the bottom portion of the image because its to wide but not have that effect the top portion of the image which is the correct width. but also keep the aspect ratio correct, keep it looking as natural as possible (its a piece of jewlery) ? how can I begin to do this.

    The area circled in red is to wide (the width) the necklace's width is as wide as the models entire chest. And also the length of the necklace it's to long it should come down to the clevage area on the model/woman.

  • On CS5, how can I recover jpeg images that were Batch Renamed prior to removal from my flashcard?

    On CS5, how can you recover JPEG images that were accidentally Batch Renamed prior to removal from a flash card? Is it a total lose or can they be saved somehow?

    If they were renamed on the flash card that is a poor practice.  If renamed in Bridge the old names can be recovered it you have checked "preserve original name in XMP".  If not you are out of luck.  But you still have the images correct?

  • How do I delete an image that is saying "can't delete"?

    How do I delete an image that is not letting me delete?

    Thank you for replying, I just tried that a few times and no go...  ugh!  It pops up a window saying, " The item "....jpg" can't be moved to the Trash because it can't be deleted." Then it just gives me an ok button option. 

  • On iphone 4 how do i block text messages that are coming from an email account?

    on iphone 4 how do i block text messages that are coming from an email account?

    There is no way to block text messages.  You may wish to report them to your carrier

  • I updated my iPod and it erased everything i had on it.  How do i retrieve the songs that i bought from the iTunes store?  when i try to download/buy them again they tell me i have already purchased them do i want to buy them again?

    I updated my iPod and it erased everything i had on it.  How do i retrieve the songs that i bought from the iTunes store?  when i try to download/buy them again they tell me i have already purchased them do i want to buy them again?  I have authorized my computer but none of them are in my music now.

    You buy one and only one download.
    It is your responsibility to move/copy/backup your music.
    Certainly you did not update your ipod without making sure that you had transferred anything purchased on the ipod to your computer and included it in your regular backup copy of your computer.

  • HT4796 How can I take the files that were migrated from my PC to my Mac and add all those files to my current user instead of having 2 users?

    How can I take the files that were migrated from my PC to my Mac and add all those files to my current user instead of having 2 users? Having to log out just to sign in on a different user to access the files is absurd.
    Do I make all the files sharable to all the NOW users on the mac then just delete the files? Or can i erase my account that I made when starting up my new mac and then just use the one with the transferred files?
    I just dont want to have to og in and out of 2 different accounts .. Help please.         
    -Nina

    Sorry. /Users is a folder path. It would be similar to C:\Users (if that exists on Windows).
    So, in the Finder, select Computer from the Go menu.
    You'll see Macintosh HD, double-click that to open it.
    In there you'll see several folders. One is Users. That is where all the user Home folders exist. Select the other account's home folder and go to step 3.
    If you have any more confusion, please stop and ask. We'll get there.
    If you feel more comfortable, you can just log into that other account and move the files into /Users/Shared.
    Then, log into the account you wish to use and copy the files from the Shared folder and paste them into your Home folder, wherever they belong, Documents, Music, Pictures, etc.  That just takes a little more work. Transferring them into Shared, and then copying into your home sets the permissions on the files so that you won't have a problem accessing them later. The steps I provided just prevent you from having to do the double move, since you are not going to use the old account once you are done.
    Quick unix shorthand. If someone gives you a file path that begins with a /, that means the root of the hard drive, ie Macintosh HD (if you haven't renamed it). The path separator in unix is /, not \.
    A path that starts with ~/ means your Home folder, the one inside /Users named with your account name.

  • How can I get my books that I download from the Library that are WMA files into my I tunes so I can listen to them

    How can I get my books that I download from the Library that are WMA files into my I tunes so I can listen to them. They have a ton of books but I can only listen to them from my windows media player and I wouldlove to download to my I pod but I have tried everything I can think of it they won't go over.  Someone said all I had to do was copy them over and they would convert but I can't even get them to copy.  Thanks.

    Well it started happening AGAIN with my 2nd IPod. No matter what I did, it Itunes would NOT restore it!
    I finally installed Itunes on my hubby's PC at work and managed to get it restored there.
    Apparently, there must be some sort of compatibility issue with the windows version of Itunes and some other piece of software on my pc.
    And one more important thing! I had to follow the instructions in the other thread that talks about how to correctly uninstall itunes and quicktime, in order to completely eliminate ALL traces of my "first" ipod's existence so it wouldn't demand that I restore it.
    I think the software got "confused" and thought when I connected my 2nd ipod, that it was the 1st and that it still needed to be restored.
    Basically, this is just POORLY written and POORLY tested software!

  • How  to find tables in Lo that  were extracted from R/3 to BW?

    Hi Experts,
    pls tell me How  to find tables in Lo that  were extracted from R/3 to BW?
    Thanks in advance.
    Regards,
    Hari Reddy

    Hi
    Check the following thread,if the earlier link doesnt work..
    How to locate which R/3 table-field is mapped to BW
    cheers

  • HT1766 How can I retreive a video that was deleted from my iphone??

    How can I retreive a video that was deleted from my iphone??

    If it was a video taken on your iPad, and if you have it backed up from the last time you did an iTunes (or iCloud) backup, then yes, you can restore your iPad using that backup.

  • TS1424 how do i solve error (-50) that stops me from connecting to i-tunes?

    how do i solve error (-50) that stops me from connecting to i-tunes?

    Maybe this will help:
    iTunes Store- "Error (-50)" when downloading purchased content
    iTunes for Mac reports error -50 when trying to authorize iTunes Store purchases

  • Operating Firefox 3.6.3 on a new net book w/windows8. How to install the .json file that I exported from home machine

    Operating Firefox 3.6.3 on a new net book w/windows8. How to install the .json file that I exported from home machine

    I have the same problem
    Use Bookmarks > Organize Bookmarks -> Import & Backup - Restore = Choose file....
    i have backup of 6 .json files
    when i choose 1st one
    This will replace all of your current bookmarks with the backup. Are you sure?
    then i click on ok
    but there is no chage in my new bookmark
    please help
    thanks in advance

  • Is it bad practice to capture an image that was deployed from mdt after adjustment?

    is it bad practice to capture an image that was deployed from mdt after adjustment?
    or there is no any consequences?
    "When you hit a wrong note it's the next note that makes it good or bad". Miles Davis

    During years I never captured the image deployed from mdt.
    Today was a rush.
    The request:
    to install time consuming configuration application into the image.
    I restored acronis image that used during couple of weeks for captures after small changes.
    And decided to capture it again before the installation of local progam and final capture.
    It failed after multiple trials. I posted the error yesterday here:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/a702bf17-8375-4bc7-b458-8ce4894f99e9/error-2147467259-during-capture?forum=mdt
    As a last tip before suggesting to deploy existing image and sysprep it 20 times I deployed the image from MDT applied just Windows KBs and captured again with MDT it worked without any prob.
    So against my usual habit I gave a deployd image for installing the tricky software and then will capture it for future deployment for 20 "special" computers. Feel not so good. But like you told:
    "Will it hurt anything?  Probably not"     I took a chance. In the image no AV, just small things like 7Z and Adobe.
    Encourage me for this case :)
    Thanks.
    "When you hit a wrong note it's the next note that makes it good or bad". Miles Davis

Maybe you are looking for

  • Replication error on windows 2012 DC

    Hi, I have added Windows 2012 R2 server (cadpdc1) to windows 2003 sp2 DC  (Primary DC) and promoted it as DC. After the promote I have ran dcdiag and it shows errors. Each of servers have three NICs connected to different networks. Please help me wit

  • Forced to remap one database object at a time

    Our application exposes a set of data objects (views) for external reporting. Field/row level data security conditions are built into the view definitions. Different access levels are segmented by schema names and in order to enable report reuse obje

  • BI : ABAP Rule in transformation

    Hi Experts , I have problem in the ABAP rule. there is an 3x update rule which contains the routine. In the transformation when i create and check the routine  , I am getting the below error : "E:The field "SOURCE_FIELDS-PEINH" cannot be changed. -".

  • Export button for crystalreportviewer control not showing ddl entries for..

    we have a .net web application that was created using asp.net 1.1.  It displays crystal reports using the crystalreportviewer control. Once the report is displayed, the user clicks on the export button and it looks just fine. so everything is ok when

  • Mail 4 Exchange / Open Xchange

    Hello, Does anyone know if it's possible to synchronize my N95 8GB with my Open Xchange server via Mail 4 Exchange ? I tried but it's not working. Server Exchange : ox.ovh.net secured connection : yes access point : WAP or WLAN User name : [email pro