Convert file from UNICODE to ANSI

Hi,
After i read-in a file using FileInputStream,
1. I need to detect if its in UNICODE format. How to do that?
2. If it is, i need to convert it into ANSI (so that i can parse it later on) How?
Any hints/solutions?
Thanks,
-V

Hi,
After i read-in a file using FileInputStream,
1. I need to detect if its in UNICODE format. How to
do that?It's very difficult to determine the encoding of an arbitrary chink of text. If you have a specific set of possibilities, then it gets easier. What are the possible encodings that file could be?
2. If it is, i need to convert it into ANSI (so that
i can parse it later on) How?
Any hints/solutions?What do you mean by ANSI encoding? There's no such thing as "ANSI encoding", but that usually referes to Windows-1252. (http://www.cs.tut.fi/~jkorpela/chars.html#win) If that's what you're also referring to, then there's not really any way to convert Unicode to 1252. Unicode is a superset of 1252. If the file has any characters outside of the range defined by 1252, then there's no conversion to be done, that character simply doesn't exist in 1252.
I recommend you read this:
The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)
http://www.joelonsoftware.com/articles/Unicode.html
Thanks,
-V

Similar Messages

  • "Convert file from:" error box

    Every time I click on a PDF file to download, the downloads window comes up and shows the download progress, and when the download finishes, a box appears that says "Convert File". In the box it says: Convert file from: then it lists various file types i.e., Text only, MS-DOS Text, Rich Text Format, HTML Document, Single File Web Page, Unicode Text and many more. It is trying to open a PDF file in Microsoft Word. I can't figure out how to change this. Help please?!

    That does not sound like Safari behavior. Are you using Safari to download, or another browser such as FireFox?
    Edit: Actually, I re-read what you wrote and saw that you said it was trying to open using MS Word. So I think the "convert file" message is coming from Word.
    Therefore, I think you have .pdf files currently set to open using MS Word. So after Safari completes the download, it is handing it off to MS Word to open, and MS Words is running and asking how to convert it to one of the formats Word supports.
    If the above sounds reasonable based on a lot of assumptions I made, you can try the following. First show any PDF file you already have in a Finder window. Right (Control) click on it, and select +Get Into+. In the Info window, look for +Open with+. In that section, if it currently set to open using Word, select either Preview (default setting) or +Adobe Reader+. Then, click the button below that setting that says +Change All+. This should change the setting so that all PDF files open with whatever app you selected that is not Word.

  • Any idea why my saved documents are unable to be read? "convert file from" box pops up, applications are listed to use but if any are chosen, the file then opens but is in symbols

    When attempting to open saved documents for viewing a box pops up "convert file from" with applications that can be chosen from to use. When any of the options are chosen the document then opens but is in symbols and is unreadable. This is happening with all saved documents.  Can you offer any help with this?

    Hi,
    If you don't find any clue, you can send your file to me (guillaume.rouyreATgcosiDOTcom, replace cap) so I can give a try.
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • Converting file from a mac to pc?

    How do I convert files from a Mac to a PC

    Are you talking about Data files such as Microsoft Office etc? Picture files such as Jpegs?
    Depending on what you are talking about, you may not even need to convert them. Please provide specific details.
    Axel F.

  • Does Adobe have a Home Use Program agreement with the U.S. Air Force so I can convert files from home?

    Does Adobe have a Home Use Program agreement with the U.S. Air Force so I can convert files from home?

    This may be helpful: Spanish PDF to Word in English

  • Convert files from Canon C300

    Hi,
    I want to convert files from Canon C300, but i can only import one by one file. Is it possible ti import all in the same time?
    The Canon C300 files are encapsulated, i just have access to MXF file when i open folder by folder.
    I'm in iMac, Yosemite.
    Thanks,
    Lise

    Thank you for the reply.  I have struggled with this problem for about 6 weeks.  Got bum information from both Canon and Adobe.  Grew discouraged.
    As a “test” after reading the discussion, I downloaded the trial version of Elements 10.  It contained RC 6.6, which would not do the S100.  I “updated”
    to 6.7 which finally did the job.  I’m really curious as to why the download of Elements 10 doesn’t “ship” with the latest RC?  I guess just to maintain
    confusion for as long as possible.
    Thanks again.  Only your reply enabled a final solution.
    Graden Harger
    Houston

  • Elements 9 w/ RAW converter 6.5 will not convert files from Canon S100.

    Elements 9 with upgraded RAW converter 6.5 will not download (or convert) files from my Canon S100.

    Thank you for the reply.  I have struggled with this problem for about 6 weeks.  Got bum information from both Canon and Adobe.  Grew discouraged.
    As a “test” after reading the discussion, I downloaded the trial version of Elements 10.  It contained RC 6.6, which would not do the S100.  I “updated”
    to 6.7 which finally did the job.  I’m really curious as to why the download of Elements 10 doesn’t “ship” with the latest RC?  I guess just to maintain
    confusion for as long as possible.
    Thanks again.  Only your reply enabled a final solution.
    Graden Harger
    Houston

  • How can I convert files from pages 08 files without pages 09?

    I am extremely dissatisfied with the latest iWork (13?) applications. My 2008 MacbookPro crashed on me, so I purchased a new 15" MacbookPro last month. Due to a known issue that prohibits my new Mac from being restored from my Time Capsule backup (thanks, Apple...), we finally got it worked out so that all my files were restored, but I had to reinstall my applications as I could find them. I had iWork 09 on my old machine, but it was from a family pack years ago, for which I do not have the discs. So, now I don't have Pages 09 to convert all my older files (I had no legitimate reason to convert my graduate work from 08 because it all worked in '08 and '09) so that I can open all my .pages files in Pages. Why would Apple make Pages that cannot open .pages files?! This is quite frustrating, and I'm hoping someone has an answer for how to convert .pages files from iWork '08 so that I can open them in the latest Pages without having to purchase iWork '09 (AGAIN!). Apple is really ramping up its leaving people behind...

    Those are your choices.
    Buy iWork '09 which is a good solution or somehow reinstall Pages '08 so you can export to Word .doc/x files.
    We warned long and hard that not updating to Pages '09 would eventually lead to Pages '08 being left behind, although Apple was particularly ruthless the way it finally did it.
    Also that anything using Apple's proprietary formats is going to end up with the same fate.
    Peter

  • How can I move back the rman convert file from file system to ASM?

    I have no idea on pluging-in the data files which were unloaded as follows:
    SQL> alter tablespace P_CDDH_DSPGD_V1_2011 read only;
    SQL> alter tablespace P_IDX_CDDH_DSPGD_V1_2011 read only;
    SQL> exec dbms_tts.transport_set_check('P_CDDH_DSPGD_V1_2011,P_IDX_CDDH_DSPGD_V1_2011',true);
    SQL> select * from transport_set_violations;
    UNIX> expdp tossadm@pmscdhf1 dumpfile=ttsfy1.dmp directory=trans_dir transport_tablespaces = P_CDDH_DSPGD_V1_2011,P_IDX_CDDH_DSPGD_V1_2011
    RMAN> convert tablespace P_CDDH_DSPGD_V1_2011, P_IDX_CDDH_DSPGD_V1_2011 format = '/appl/oem/backup/temp/%I_%s_%t_extbspace.dbf';
    Starting conversion at source at 03-OCT-13
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=116 instance=pmscdhf11 device type=DISK
    channel ORA_DISK_1: starting datafile conversion
    input datafile file number=00079 name=+PMSCDHF1/p_cddh_dspgd_v1_2011_01.dbf
    converted datafile=/appl/oem/backup/temp/3536350174_2820_827849001_extbspace.dbf
    channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:02:15
    channel ORA_DISK_1: starting datafile conversion
    input datafile file number=00080 name=+PMSCDHF1/p_idx_cddh_dspgd_v1_2011_02.dbf
    converted datafile=/appl/oem/backup/temp/3536350174_2821_827849136_extbspace.dbf
    channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:01:45
    Finished conversion at source at 03-OCT-13
    Starting Control File Autobackup at 03-OCT-13
    piece handle=/dbms/oracle/r1110/db_01/dbs/c-3536350174-20131003-02 comment=NONE
    Finished Control File Autobackup at 03-OCT-13
    SQL> drop tablespace P_CDDH_DSPGD_V1_2011 including contents;
    SQL> drop tablespace P_IDX_CDDH_DSPGD_V1_2011 including contents;
    Afterward, how can I relocate the backup files "/appl/oem/backup/temp/3536350174_2820_827849001_extbspace.dbf", "/appl/oem/backup/temp/3536350174_2821_827849136_extbspace.dbf" back to the ASM group +PMSCDHF1 ???

    The 11.1 documentation only says  "Enables you to copy files between ASM disk groups on local instances to and from remote instances" and "You can also use this command to copy files from ASM disk groups to the operating system."
    http://docs.oracle.com/cd/B28359_01/server.111/b31107/asm_util.htm#CHDJEIEA
    The 11.2 documentation says "Copy files from a disk group to the operating system  Copy files from a disk group to a disk group Copy files from the operating system to a disk group"
    http://docs.oracle.com/cd/E11882_01/server.112/e18951/asm_util003.htm#CHDJEIEA
    I've never tried 11.1
    Hemant K Chitale

  • Convert String from ASCII to ANSI

    Hi,
    a command line instruction via LabVIEW function "System Exec.vi" retrieves me a string in ASCII format. Is there a function to convert string from ASCII to ANSII format? I use LabVIEW 8.5 German Installation.
    Kind Regards
    Christian
    Test Engineering
    digades GmbH
    www.digades.com

    Hallo Christian,
    AFAIK there is no such in function in LabView...
    But you can:
    - use "Search and replace string" to search for ASCII chars and replace them by their corresponding ANSI char, do this in a loop for all chars to be replaced (acceptable speed for small strings...)
    - convert the string to an U8 array and use a lookup table to convert all bytes from ASCII to ANSI, convert back to string (may be faster for long strings...)
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Convert files from .UPX to .PSD

    How can I convert files to photoshop elements .PSD format from Photo Explosion .UPX format? I am trying to move work I created with Photo Explosion because that program crashed and will not reinstall and run. I still have Photo Explosion running on an older computer and it will convert my files to PSD but merges all layers.

    If you are using ExportPDF, the forum to ask is here:
    http://forums.adobe.com/community/exportpdf
    And don't forget to explain your problem and your setup in detail, including full error messages if any.

  • Vietnamese Language Support Services Menu Convert Encoding from Unicode-VNI

    I am running :
    Macbook 13 unibody
    Clean install Snow Leopard
    I have Vietnamese input method in Languages and Input Method Systems Preferences on
    Problem :
    When I was running Leopard, I somehow was able to see in the Services Menu "convert from unicode to vni," and other encodings, and vice versa while working in TextEdit, MS Word, and other applications that supported it.
    After doing a new and clean install on my machine. I am no longer able to see these options in the Services Menu, nor am I able to even find where and how to enable this in Systems Preferences.
    Please HELP HELP HELP it was an absolute life saver for me to work with all the different encodings and input methods for Vietnamese language.

    omg that was it. I had already installed the app from that link but it didn't show up in services because I guess I didn't log out properly for the installation to finish putting the service items on. & since I wasn't able to find the services after installation I assumed it must have been a part of the Leopard. Because you suggested, I installed again, and logged out as I was supposed to, and voila, the Vietnamese encoding conversion items for Services Menu. thanks you.

  • Why do I continue to receive an error msg when converting files from pdf to Word?

    Why do I continue to receive an error msg when converting pdf files to Word?

    HI tatamene,
    I'm sorry that you're having trouble converting a document.  For starters, have you verified that your account is active? (You can check by logging in to www.adobe.com and checking under My Subscriptions and Services). Aside from that, I'll need a little more info to get to the bottom of your problem.
    Are you trying to convert the file from within Reader, or directly via the ExportPDF website?
    What operating system and browser are you using?
    How large is the file that you're trying to convert? (There's a file-size limit of 100 MB.)
    Is the computer that you're using networked?
    Do other files convert without error?
    I look forward to hearing back from you.
    Best,
    Sara

  • Convert file from 2012 to 2011

    Hi people
    Can anyone convert the attached file from 2012 to 2011 version, please?
    Attachments:
    Peak detector.vi ‏552 KB

    Here you go.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Peak detector.vi ‏570 KB

  • How do I convert files from .mts to something recognizeable by iMovie?

    I've been trying to convert .mts files saved on a hard drive (I don't have the original file structure from the camcorder) into into something readable by iMovie. I have tried all the available formats in Toast Titanium, but the converted files are always greyed out in iMovie when I try to import them.
    This has been extremely frustrating, and has led me to wonder what Apple was thinking when they made iMovie so picky about what it will accept. I've looked on various forums, but haven't found any solutions to my proble, so any help here would be greatly appreciated.

    Also, have a look at Voltaic here:
    http://www.shedworx.com/voltaichd
    Before purchasing my Intel MacBook Pro I used a much earlier version of Voltaic to convert my AVCHD footage into AIC (Apple Intermediate Codec) for use in iMovie '08. It was slow but worked very well.
    iMovie '09 actually converts AVCHD clips into the AIC format when importing the MTS files from a camera or from a FULL camera archive. The full archive includes all the contents of the camera, including the clips index - as you've discovered. However, Voltaic only needs the clips, not the full camera contents.
    John

Maybe you are looking for