Incorrectly opening files as UTF-16

I do a lot of web editing and have a variety of HTML files with the following line in them:
<META http-equiv=Content-Type content="text/html; charset=unicode">
Now that I have Leopard, anytime I open these files, it fills the screen with chinese characters. I've found that if I go into TextEdit, and select anything except Unicode (UTF-16) when opening the file, the file loads as it should.
It seems that every program (TextEdit, Dreamweaver, etc) is now trying to load these (English) files at UTF-16 and it's converting them into Chinese.
Any ideas on how to disable this "feature" or make TextEdit into a true text (only) editor?

Hi Krishna,
try to use:
    response->set_header_field( name = 'Content-Type'
                                value = 'application/vnd.ms-excel' ).
to set the correct content type for the file (example above Excel).
Also place the coding in the OnRequest Event and not on the Layout of the page with flow logic. As an alternative you can use a controller with a controller class. In there redefine the method do_request and place the coding for creating the response therein. The coding should look similar to:
*  send back the file
    response->set_header_field( name  = 'Content-Type'
                                value = ls_file-content_type ).
  response->delete_header_field( 'Cache-Control' ).         "#EC NOTEXT
  response->delete_header_field( 'Expires' ).               "#EC NOTEXT
  response->delete_header_field( 'Pragma' ).                "#EC NOTEXT
  CONCATENATE 'inline; filename="' ls_file-name INTO lv_string.
  response->set_header_field( name = 'Content-Disposition'
                              value = lv_string ).
  response->set_data( ls_file-content ).
In the example above lv_string has type string and ls_file is a structure containing strings for name and content-type and an xstring for the file content.
I usually don't set the content length as I have enabled compression and then the icm calculates the content length for me after compression.
Hope that helps.
Best Regards
Michael

Similar Messages

  • 1.5.1 Opening File in PlsqlNode incorrectly displays a default connection

    SQL Developer 1.5.1.54.40, JDK 1.6.0_04, Win XP SP 2
    I have just noticed that opening a file as a PlsqlNode (based on file type preferences) displays a default connection (the connection for the current tab). However, when compiling, you are prompted to select which connection you want to run against - ie there is no connection associated with the editor. This happens regardless of how you open the file (File > Open, Open toolbar button, Ctrl-O, double click in Files navigator).
    This does not happen for SQL Script file types, where no connection is displayed on opening them.
    theFurryOne

    Bug 7171360 - opening file in plsqlnode incorrectly displays a default connection
    logged.
    -Raghu

  • Error 7 occurred at Open File+.vi:Open File,NI-488: Nonexistent GPIB interface

    I did some clean-up of my computer and have been having issues ever since.
    I'm not the one that did the programming; the person who did is long gone.
    The VI loads fine but when I hit run I get:
    Error 7 occurred at Open File+.vipen File
    LabVIEW:  File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS, and / on Linux. Verify that the path is correct using the command prompt or file explorer.
    =========================
    NI-488:  Nonexistent GPIB interface.
    All the necessary VIs are available and I've tried changing all the file calls in the VIs to the new locations but the error is the same.
    Any suggestions?
    Thanks.

    Error 7 is a generic file not found.  If it is happening after cleaning up files, more than likely you moved some subVIs called in a main VI to a new location on your computer.  If all the VIs are in a project, a possible solution would be to remove the vis in the project directory and add them back to the project as they may be pointing to a previous location where the files were once stored.  Perhaps this is what Anon123123123 meant by "linking".  Hope this helps.
    Regards,
    Isaac S.
    Regards,
    Isaac S.
    Applications Engineer
    National Instruments

  • CONVERSION FROM ANSI ENCODED FILE TO UTF-8 ENCODED FILE

    Hi All,
    I have some issues in conversion of ANSI encoded file to utf encoded file. let me tell you in detail
    I have installed the Language Support for Thai Language on My Operating System.
    now, when I open my notepad and add thai character on the file and save it as ansi encoding. it saves it perfectly and also I able to see it on opening the file again.
    This file need to be read by my application , store in database and should display thai character on jsp after fetching the data from database. Currently it is showing junk character on jsp reason being that my database (UTF8 compliant database) has junk data . it has junk data because my application is not able to read it correctly from the file.
    If I save the file with encoding as UTF 8 it works fine. but my business requirement is such that the file is system generated and by default it is encoded in ANSI format. so I need to do the conversion of encoding from ANSI to UTF8 . so Any of you can guide me on the same how to do this conversion ?
    Regards
    Gaurav Nigam

    Guessing the encoding of a text file by examining its contents is tricky at best, and should only be done as a last resort. If the file is auto-generated, I would first try reading it using the system default encoding. That's what you're doing whenever you read a file with a FileReader. If that doesn't work, try using an InputStreamReader and specifying a Thai encoding like TIS-620 or cp838 (I don't really know anything about Thai encodings; I just picked those out of a quick Google search). Once you've read the file correctly, you can write the text to a new file using an OutputStreamWriter and specifying UTF-8 as the encoding. It shouldn't really be necessary to transcode files like this, but without knowing a lot more about your situation, that's all I can suggest.
    As for native2ascii, it isn't for encoding conversions. All it does is replace each non-ASCII character with its six-character Unicode escape, so "voil&#xE1;" becomes "voil\u00e1". In other words, it avoids the problem of character encodings by converting the file's contents to a form that can be stored as ASCII. It's mainly used for converting property or resource files to a form that can be read by the Properties and ResourceBundle classes.

  • Can't save file in UTF-8 encoding

    Hi,
    I've read everything I can find on this subject, from these forums to Google to newsgroups. Still no success.
    I am simply trying to save a file in UTF-8 format.
    This code depicts the methods I'm using:
    File file = new File("myFile");
    FileOutputStream fos = new FileOutputStream(file);
    OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");
    System.out.println("Encoding is " + osw.getEncoding());
    osw.write(myStringBuffer.toString());
    When this code is run, this is printed:
    Encoding is UTF8
    However, when I check the output file itself, it is ANSI 1252. I've tried compiling and running in both 1.4.2 and 1.5.0. Same results.
    Thanks for your help...

    I have checked it with two separate tools.
    1. I have opened up the file in TextPad and viewed the file properties. TextPad reports this: "code set: ANSI"
    2. I have a command-line utility that is bundled with a 3rd party application (commercial search engine). The command-line utility reports the character set and the language of a text file. The command-line utility reports this: "CHARSET: 1252"
    Is there something else to try?

  • In CS4, "Cannot open file" "Please upgrade your plug-ins..."

    Greetings,
    I am using InDesign CS4 on a PC. I am trying to open an .indd file created by our marketing department. I don't know what version of InDesign they use nor whether they work on Macs or PCs.
    When I double-click to open the file, I get a "Cannot Open File" popup box. The box reads "Cannot open docname.indd. Please upgrade your plug-ins to their latest versions, or upgrade to the latest version of Adobe InDesign." It then lists 18 different plugins:
    ASSIGNMENTS.RPLN
    TEXT.RPLN
    SPREAD.RPLN
    MASTER PAGE.RPLN
    TEXT ATTRIBUTES.RPLN
    .... and 13 more.
    When I go to Help > Configure Plug-Ins, I can see that I do have all of these plug-ins. But apparently they are not the latest versions.
    Anyone know how I can update these plugins? I have searched for them on the Adobe website, but no joy.
    Thanks in advance.
    Jen

    It's a safe bet that they are working in CS5. The only way to get those plugins is to install CS5 on your machine.
    You could ask your marketing department to export an IDML file from CS5, which you can open up in CS4, but it might fail horribly (and it's guaranteed to lay out incorrectly if they've used any tools in CS5 that aren't in CS4). If you rely on this workflow, by regularly using a document going back and forth between CS5 and CS4, chances are very, very good that it will fail at a critical moment. The only really safe thing to do here is to get everyone using the same version of InDesign.

  • TextEdit no longer opens files it used to open just fine.

    Ever since I upgraded to Snow Leopard, TextEdit has been giving me an error message when I try to open various text files: "The document “CRD-FONT.TXT” could not be opened. Text encoding Unicode (UTF-8) isn’t applicable."
    I wish I knew how to set TextEdit to open the file anyway. I am sure it can be done; it used to open these files just fine. The files didn't change.
    I had to download and install another company's editor just so I could open files that I used to work with in TextEdit. It's good to have the other editor, but it'd be great if TextEdit went back to being able to open these files without complaint.
    Is there a setting in prefs that would resolve this? I may have changed a setting without realizing it would cause this.

    Sounds like there's something wrong with the file, though what that might be I'm not sure. I don't know enough about encodings to know, but sounds like there's probably a mismatch between the file's encoding and what the file claims its encoding is.
    Try opening it with [TextWrangler|http://www.barebones.com/products/TextWrangler>, then choose Edit -> Document Options and see what the encoding is reported to be there.

  • Link in Adobe AIR JavaScript app is incorrectly opening the app in the default browser

    I have a couple of links in my Adobe AIR JavaScript app that are part of the app's UI, which when clicked are causing the app to be loaded into a new tab in my default browser.
    This is only happening with two links (Save and Cancel on a form), and not all links in my UI.  The two links that are having the issue are defined in an external HTML file that I load a runtime and connect to the DOM.  The links that are defined in the main HTML file that is loaded when the app starts up do not have this problem.
    Here is how I am loading the template and plugging it into the DOM
    var win = document.createElement("div");
    var f = air.File.applicationDirectory.resolvePath("lib/partials/edit_form.html");
    var fs = new air.FileStream();
    fs.open(f, air.FileMode.READ);
    var content = fs.readUTFBytes(fs.bytesAvailable);
    fs.close();
    var template = new Template(content);
    win.innerHTML = template.evaluate(data);
    document.body.insertBefore(win, document.body.firstChild);
    The links themselves are coded like this:
    <a href="#" id="save_button" onclick="return false;"></a>
    <a href="#" id="cancel_button" onclick="return false;"></a>
    I am using the Prototype JS library to observe the 'click' event for each of these links like so:
    $('save_button').observe('click', onSave);
    $('save_button').observe('click', onCancel);
    This app shows content created by users, which can contain links to external web sites.  To get the external links to open in the browser (as opposed to inside my Adobe AIR window), I am doing the following in a script tag in the head of my main HTML file:
    window.htmlLoader.navigateInSystemBrowser = true
    I've found that if I set window.htmlLoader.navigateInSystemBrowser = false, then the issue with the Save and Cancel links described above goes away.  However, I need to have window.htmlLoader.navigateInSystemBrowser = true so that external links in the user content open up in the browser, not in Adobe AIR.
    Another piece of evidence is that the Save and Cancel links only incorrectly open a browser the first time you click on them after launching the app.  Subsequent clicks work fine and do not have the issue.
    Any ideas on why the links that are plugged into the DOM after app start up have this issue, and only the first time you click on them?

    Not sure where this comes from, but I suspect it has something to do with the security restrictions that AIR has in place, related to dynamic JS evaluation after the document is loaded.
    Make sure you read http://help.adobe.com/en_US/air/html/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7f0e.html#WS 5b3ccc516d4fbf351e63e3d118666ade46-7ef8
    For example, I've spotted the two onclick="return false;" you have in your code. The evaluation of the onclick attribute after the page loaded event would fail in AIR.

  • Photoshop CS4 error since Mavericks when open file from Server: "file is empty"

    Since I upgraded to Mavericks I can't open files directly from a Server (smb://..), it says "file is empty". When I copy the PSD file to my local drive I can open it though. I tried already to remove the server and reconnect. I'm using the CS4. Any idea how to fix that?

    My solution from another thread:-
    Hello - I recently upgraded to Mavericks and have experienced a number of problems, one of which matches yours, and after some experimentation found a solution.
    Like you, whenever I tried to open a file held on the server in any Adobe software, I would get an error that the file is empty. However, if I copied the file to my desktop, it would open without issue. i then noticed that the server name, which has a space in it, had %20 instead of a space, which drew me to the conclusion that Mavericks was reading the server incorrectly. I ejected the mounted server icons, and then click 'Go', 'Connect to Server', and reconnected. The server reconnected (and this time that space was restored) and I could open all of my files without issue.
    Hope this helps

  • Convert a UTF-16 format  file to UTF-8 format

    Hi all
          I have a xml file in UTF-16 format I have to convert it into UTF-8 format so that
    it can be opened with Internet Explorer.now when i am opening the file its showing error"<b>Whitespace is not allowed at this location. Error processing resource 'file</b>"
                    the file content is given below
                 < ? x m l   v e r s i o n = " 1 . 0 "   e n c o d i n g = "
    u t f - 8 " ? >
    < _ G L B - R G T X _ O R D E R S C P G >
         < I D O C   B E G I N = " 1 " >
             < E D I _ D C
    4 0   S E G M E N T = " 1 " >
                 < T A B N A M > E
    D I _ D C 4 0 < / T A B N A M >
                 < M A N D T > 1
    5 2 < / M A N D T >
                 < D O C N U M > 0 0 0 0 0 0
    0 0 0 2 7 5 9 7 2 2 < / D O C N U M >
                 < D O C R
    E L > 6 2 0 < / D O C R E L >
                 < S T A T U S > 3
    0 < / S T A T U S >
                 < D I R E C T > 1 < / D I R
    E C T >
                 < O U T M O D > 2 < / O U T M O D >
             < E X P R S S / >
                 < T E S T / >
          < I D O C T Y P > O R D E R S 0 5 < / I D O C T Y P >
                 < C I M T Y P > / G L B / R G T X _ O R D E R S
    C P G < / C I M T Y P >
                 < M E S T Y P > O R D C
    H G < / M E S T Y P >
                 < M E S C O D / >
         < M E S F C T / >
                 < S T D / >
    < S T D V R S / >
                 < S T D M E S > O R D C H G <
    / S T D M E S >
                 < S N D P O R > S A P G E 7 < /
    S N D P O R >
                 < S N D P R T > L S < / S N D P R
    T >
                 < S N D P F C / >
                 < S N D P R
    N > G E 7 Q A R 3 1 5 2 < / S N D P R N >
                 < S N
    D S A D / >
                 < S N D L A D / >
                 < R
    C V P O R > A 0 0 0 0 0 0 0 4 0 < / R C V P O R >
      < R C V P R T > L S < / R C V P R T >
                 < R C V
    P F C > L S < / R C V P F C >
                 < R C V P R N > R
    L E C P G W D I 1 < / R C V P R N >
                 < R C V S A
    D / >
                 < R C V L A D / >
                 < C R E D
    A T > 2 0 0 7 0 6 0 5 < / C R E D A T >
                 < C R E
    T I M > 1 5 4 1 5 3 < / C R E T I M >
                 < R E F I
    N T / >
                 < R E F G R P / >
                 < R E F
    M E S / >
                 < A R C K E Y / >
                 < S E
    R I A L > B U S 2 0 1 2       1 1 0 0 0 0 0 3 0 1 < / S E R
    I A L >
             < / E D I _ D C 4 0 >
             < E 1 E D K
    0 1   S E G M E N T = " 1 " >
                 < C U R C Y > E U
    R < / C U R C Y >
                 < W K U R S > 1 . 0 0 0 0 0 <
    / W K U R S >
                 < Z T E R M > Z 0 0 1 < / Z T E R
    M >
                 < B S A R T > N B < / B S A R T >
       < B E L N R > 4 5 2 0 0 2 2 0 7 2 1 1 0 0 0 0 0 3 0 0 < /
    B E L N R >
                 < R E C I P N T _ N O > 0 1 0 0 0 0
    0 0 0 5 < / R E C I P N T _ N O >
                 < A B R V W _
    B E Z > B U S 2 0 1 2       1 1 0 0 0 0 0 3 0 0 < / A B R V
    W _ B E Z >
                 < _ G L B - R G T _ C H A N G E F L
    A G   S E G M E N T = " 1 " >
                     < Q U A L F >
    0 0 2 < / Q U A L F >
                     < F L A G > X < / F L
    A G >
                 < / _ G L B - R G T _ C H A N G E F L A G
    >
                 < _ G L B - R G T _ C P G D A T A   S E G M E
    N T = " 1 " >
                     < L A N G U > e n < / L A N G
    U >
                     < C O N S I G N _ F L A G > S < / C O N
    S I G N _ F L A G >
                     < I N D I C A T > S < /
    I N D I C A T >
                 < / _ G L B - R G T _ C P G D A
    T A >
             < / E 1 E D K 0 1 >
             < E 1 E D K 1 4 
    S E G M E N T = " 1 " >
                 < Q U A L F > 0 1 4 <
    / Q U A L F >
                 < O R G I D > Z 2 0 0 < / O R G I
    D >
             < / E 1 E D K 1 4 >
             < E 1 E D K 1 4  
    S E G M E N T = " 1 " >
                 < Q U A L F > 0 0 9 < /
    Q U A L F >
                 < O R G I D > 0 0 3 < / O R G I D >
             < / E 1 E D K 1 4 >
             < E 1 E D K 1 4   S E
    G M E N T = " 1 " >
                 < Q U A L F > 0 1 3 < / Q U
    A L F >
                 < O R G I D > N B < / O R G I D >
       < / E 1 E D K 1 4 >
             < E 1 E D K 1 4   S E G M E
    N T = " 1 " >
                 < Q U A L F > 0 1 1 < / Q U A L F
    >
                 < O R G I D > Z 2 0 1 < / O R G I D >
    < / E 1 E D K 1 4 >
             < E 1 E D K 0 3   S E G M E N
    T = " 1 " >
                 < I D D A T > 0 1 2 < / I D D A T >
                 < D A T U M > 2 0 0 7 0 5 1 8 < / D A T U M >
           < / E 1 E D K 0 3 >
             < E 1 E D K 0 3   S E G
    M E N T = " 1 " >
                 < I D D A T > 0 1 1 < / I D D
    A T >
                 < D A T U M > 2 0 0 7 0 5 1 8 < / D A T U
    M >
             < / E 1 E D K 0 3 >
             < E 1 E D K A 1  
    S E G M E N T = " 1 " >
                 < P A R V W > A G < / P
    A R V W >
                 < P A R T N > 2 0 0 0 0 1 2 < / P A R
    T N >
                 < T E L F 1 > + 4 1 2 1 9 2 4 1 8 6 8 < /
    T E L F 1 >
                 < T E L F X > + 4 1 2 1 9 2 4 1 8 6
    7 < / T E L F X >
                 < B N A M E > P l a n t   O p
    e r .   B u y e r < / B N A M E >
                 < P A O R G >
    Z 2 0 0 < / P A O R G >
                 < O R G T X > E u r o p
    e < / O R G T X >
                 < P A G R U > 0 0 3 < / P A G
    R U >
             < / E 1 E D K A 1 >
             < E 1 E D K A 1 
    S E G M E N T = " 1 " >
                 < P A R V W > L F < /
    P A R V W >
                 < P A R T N > 0 1 0 0 0 0 0 0 0 5 <
    / P A R T N >
                 < N A M E 1 > I n t e r n a t i o
    n a l   A g r o . < / N A M E 1 >
                 < S T R A S >
    1 4   R u e   d e   S a h o n e < / S T R A S >
    < S T R S 2 > C h r i s t < / S T R S 2 >
                 < P F
    A C H > 1 5 5 < / P F A C H >
                 < O R T 0 1 > L y
    o n < / O R T 0 1 >
                 < P S T L Z > 1 0 2 0 4 < /
    P S T L Z >
                 < L A N D 1 > F R < / L A N D 1 >
               < T E L F 1 > 0 8 1 < / T E L F 1 >
    < S P R A S > E < / S P R A S >
                 < B N A M E > A
    l f r e d o < / B N A M E >
                 < I L N N R > 7 6 5
    4 3 2 1 5 4 3 2 1 5 < / I L N N R >
                 < S P R A S
    _ I S O > E N < / S P R A S _ I S O >
                 < _ G L B
    - R G T _ T A X C O D E S   S E G M E N T = " 1 " >
            < S P T N U M > 3 4 5 < / S P T N U M >
        < C Y T A X N U M > 4 5 6 < / C Y T A X N U M >
            < O T R I N F O > F R 9 8 7 1 2 5 6 4 4 4 2 < / O T
    R I N F O >
                 < / _ G L B - R G T _ T A X C O D E
    S >
             < / E 1 E D K A 1 >
             < E 1 E D K A 1  
    S E G M E N T = " 1 " >
                 < P A R V W > E K < / P
    A R V W >
                 < N A M E 1 > F R   P L   N e u t r a
    l i a < / N A M E 1 >
                 < N A M E 2 > G T   C o p
    y   R e f e r e n c e   F a c t o r y < / N A M E 2 >
          < S T R A S > G l o b e   S t r e e t   Z 2 0 3 < / S
    T R A S >
                 < O R T 0 1 > N e u t r a l i a < / O
    R T 0 1 >
                 < P S T L Z > 9 9 9 9 9 < / P S T L Z
    >
                 < L A N D 1 > F R < / L A N D 1 >
    < B N A M E > A l e s s a n d r o   V e r r e s c h i < / B
    N A M E >
                 < I L N N R > 5 0 0 0 2 4 3 0 0 0 4 9
    7 < / I L N N R >
                 < _ G L B - R G T _ T A X C O
    D E S   S E G M E N T = " 1 " >
                     < C R N U M
    > 2 9 8 < / C R N U M >
                     < S P T N U M > 3 9
    8 < / S P T N U M >
                     < C Y T A X N U M > 4 9
    8 < / C Y T A X N U M >
                 < / _ G L B - R G T _ T
    A X C O D E S >
                 < _ G L B - R G T _ C P G M I D
      S E G M E N T = " 1 " >
                     < S M T P _ A D D
    R > a l e s s a n d r o . v e r r e s c h i @ n e s t l e .
    c o m < / S M T P _ A D D R >
                 < / _ G L B - R G
    T _ C P G M I D >
             < / E 1 E D K A 1 >
             < E
    1 E D K A 1   S E G M E N T = " 1 " >
                 < P A R V
    W > L S < / P A R V W >
                 < P A R T N > 0 1 0 0 0
    0 0 0 0 5 < / P A R T N >
                 < I L N N R > 7 6 5 4
    3 2 1 5 4 3 2 1 5 < / I L N N R >
             < / E 1 E D K A 1
    >
             < E 1 E D K A 1   S E G M E N T = " 1 " >
         < P A R V W > W E < / P A R V W >
                 < N A M
    E 1 > F R   P L   N e u t r a l i a < / N A M E 1 >
        < N A M E 2 > G T   C o p y   R e f e r e n c e   F a c
    t o r y < / N A M E 2 >
                 < S T R A S > G l o b e
      S t r e e t   Z 2 0 3 < / S T R A S >
                 < O R T
    0 1 > N e u t r a l i a < / O R T 0 1 >
                 < P S T
    L Z > 9 9 9 9 9 < / P S T L Z >
                 < L A N D 1 > F
    R < / L A N D 1 >
                 < _ G L B - R G T _ E 1 E D K
    A 1   S E G M E N T = " 1 " / >
             < / E 1 E D K A 1 >
             < E 1 E D K A 1   S E G M E N T = " 1 " >
       < P A R V W > R G < / P A R V W >
                 < N A M E
    1 > G L O B E   R e f e r e n c e   F r a n c e < / N A M E
    1 >
                 < S T R A S > S t r e e t   1 < / S T R A S
    >
                 < O R T 0 1 > C i t y < / O R T 0 1 >
         < P S T L Z > 1 2 3 4 5 < / P S T L Z >
                 <
    L A N D 1 > F R < / L A N D 1 >
                 < I L N N R > 5
    0 0 0 2 4 3 0 0 0 7 0 1 < / I L N N R >
                 < _ G L
    B - R G T _ T A X C O D E S   S E G M E N T = " 1 " >
              < C O T A X N U M > 1 2 3 4 < / C O T A X N U M >
                     < C R N U M > 1 2 3 4 5 6 7 8 < / C R N U M
    >
                     < S P T N U M > 1 0 0 5 1 9 6 2 < / S P T
    N U M >
                     < C Y T A X N U M > 1 0 0 5 1 9 6 2
    < / C Y T A X N U M >
                     < O T R I N F O > 0 0
    0 0 0 0 0 5 6 7 8 9 < / O T R I N F O >
                     < J
    U R C O D E > 1 0 0 5 1 9 6 2 < / J U R C O D E >
      < / _ G L B - R G T _ T A X C O D E S >
             < / E 1 E
    D K A 1 >
             < E 1 E D K 0 2   S E G M E N T = " 1 " >
                 < Q U A L F > 0 0 1 < / Q U A L F >
    < B E L N R > 4 5 2 0 0 2 2 0 7 2 < / B E L N R >
       < D A T U M > 2 0 0 7 0 5 1 8 < / D A T U M >
    < U Z E I T > 1 4 0 4 4 0 < / U Z E I T >
             < / E 1
    E D K 0 2 >
             < E 1 E D K 1 8   S E G M E N T = " 1 "
    >
                 < Q U A L F > 0 0 1 < / Q U A L F >
       < T A G E > 3 0 < / T A G E >
                 < P R Z N T >
    2 . 0 0 0 < / P R Z N T >
             < / E 1 E D K 1 8 >
       < E 1 E D P 0 1   S E G M E N T = " 1 " >
                 <
    P O S E X > 0 0 0 1 0 < / P O S E X >
                 < A C T I
    O N > 0 0 2 < / A C T I O N >
                 < P S T Y P > 0 <
    / P S T Y P >
                 < M E N G E > 1 0 0 . 0 0 0 < / M
    E N G E >
                 < M E N E E > E A < / M E N E E >
             < B M N G 2 > 1 0 0 . 0 0 0 < / B M N G 2 >
         < P M E N E > E A < / P M E N E >
                 < V P R
    E I > 1 0 < / V P R E I >
                 < P E I N H > 1 < / P
    E I N H >
                 < N E T W R > 1 0 0 0 < / N E T W R >
                 < N T G E W > 8 0 0 < / N T G E W >
    < G E W E I > K G M < / G E W E I >
                 < M A T K
    L > P 2 0 < / M A T K L >
                 < B P U M N > 1 < / B
    P U M N >
                 < B P U M Z > 1 < / B P U M Z >
           < B R G E W > 1 0 0 0 < / B R G E W >
                 <
    W E R K S > Z 2 0 3 < / W E R K S >
                 < E 1 E D P
    0 4   S E G M E N T = " 1 " >
                     < M W S B T >
    0 . 0 0 < / M W S B T >
                 < / E 1 E D P 0 4 >
             < E 1 E D P 2 0   S E G M E N T = " 1 " >
           < W M E N G > 1 0 0 . 0 0 0 < / W M E N G >
           < A M E N G > 0 . 0 0 0 < / A M E N G >
       < E D A T U > 2 0 0 7 0 5 1 8 < / E D A T U >
         < E Z E I T > 1 4 5 0 0 0 < / E Z E I T >
       < _ G L B - R G T _ S L I D 0 1   S E G M E N T = " 1 " >
                         < E T E N R > 0 0 0 1 < / E T E N R >
                   < / _ G L B - R G T _ S L I D 0 1 >
       < / E 1 E D P 2 0 >
                 < E 1 E D P 1 9   S E G
    M E N T = " 1 " >
                     < Q U A L F > 0 0 1 < / Q
    U A L F >
                     < I D T N R > 0 0 0 0 0 0 0 0 0 0
    4 3 0 0 0 0 9 8 < / I D T N R >
                     < K T E X T
    > C a r t o n s   -   C e r e a l s   M i l k   2 4 x 4 5 0 
    g < / K T E X T >
                 < / E 1 E D P 1 9 >
        < E 1 E D P 1 9   S E G M E N T = " 1 " >
      < Q U A L F > 0 0 3 < / Q U A L F >
                     < I D
    T N R > 0 7 6 1 2 2 9 7 0 1 6 1 1 9 < / I D T N R >
        < / E 1 E D P 1 9 >
             < / E 1 E D P 0 1 >
    < E 1 E D S 0 1   S E G M E N T = " 1 " >
                 < S
    U M I D > 0 0 2 < / S U M I D >
                 < S U M M E > 1
    0 0 0 < / S U M M E >
                 < S U N I T > E U R < / S
    U N I T >
             < / E 1 E D S 0 1 >
             < E 1 E D S
    0 1   S E G M E N T = " 1 " >
                 < S U M I D > 0 0
    5 < / S U M I D >
                 < S U M M E > 0 < / S U M M E
    >
             < / E 1 E D S 0 1 >
         < / I D O C >
    < / _ G L
    B - R G T X _ O R D E R S C P G >

    Hi Saurabh,
    your xml is not wellformed coz there are spaces in the prolog between the first character '<' and the '?'. Coz of any reason there are spaces between all characters, that is making your document not readable for parsers including IE. For your task to convert to UTF-8 you can use a XSLT mapping with element "output" and attribut "encoding"
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output encoding="UTF-8"/>
         <xsl:template match="/">
    Regards,
    Udo

  • Downloading file in UTF-8 format

    Hi,
    I want to download a file in UTF-* format.
    i have written the following code to download it in UTF-8.
    OPEN DATASET L_filename FOR OUTPUT IN TEXT MODE ENCODING UTF-8.
    LOOP AT p_struct INTO w_struct.
    TRANSFER w_struct TO l_filename.
    CLEAR w_struct.
    ENDLOOP.
    CLOSE DATASET l_filename.
    my question how do i check the file whether it is been downloaded in UTF-8 or not?
    Thanks in advance.
    neha

    Hi!
    You have to download it into your PC. For this, use an FTP program (f.e smartftp).
    Then use a text editor to check its format, for example PSPAD text editor.
    Regards
    Tamá

  • Create new text file in UTF-8 format by default

    I'm working a lot with UTF-8 text files and mainly in this format. It's becoming annoying when I have to manually save every text file as UTF-8.  After several trial-and-errors, I've made up a procedure that I've put in a blog. I think I could share
    it here for those who need it.  Hope it helps.
    http://instrumenti-meliora.blogspot.com/2014/04/create-new-text-file-in-utf-8-format-by.html

    You've made a procedure?
    Are you sure you didn't :
    Didn't what?
    https://www.google.com/#q=change+notepad+default+encoding
    Well, I'm not sure what you want me to see, but your search keywords do
    NOT make sense.  You do note change *Notepad* default encoding.  What you can change is a
    TEXT file's default encoding.
    Well, of course, if you have access to Notepad source code and you're able to change it and re-compile again, then you could really say you change Notepad's "default encoding", which I suppose would mean "default encoding every time we save".
    Why wouldn't you just provide a link (or some attribution) to the top result
    http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/default-utf-8-encoding-for-new-notepad-documents/525f0ae7-121e-4eac-a6c2-cfe6b498712c
    or a link to watch this done on youtube?
    http://www.youtube.com/watch?v=GnL6smxQE9k
    The title of that forum post and Youtube video is a non-sense.  New
    "Notepad" document?  Come on!  That's apparently how a newbie think what it is and it's very likely he has not a clue what it is and what he is doing.  And what if I don't use Notepad to create such file?  If I
    use UltraEdit, then mine should be "UltraEdit" document and that should be different from Notepad document, correct? LOL
    The fact that you're able to find this video would also mean you're thinking like him in that the file is really called Notepad document LOL
    For your information, that's called a text file (or document if you prefer this prettier term).  It's also called plain text file.
    Now, let's see the content of both links:
    First of all, why did they tell people to create a new text file somewhere and then
    COPY it to template folder?  That's really so dumb
    LOL  Isn't it more intelligent to create such file directly INSIDE the folder?
    Secondly, their procedures are not foolproof.  What if the Windows directory is not c:\windows?  They should tell people to open %Systemroot%\ShellNew instead.  I suppose they don't even know how this folder is called because
    nowhere is the term "template folder" ever mentioned.
    Thirdly, what if that folder doesn't work for unknown reason (which might happen in XP)?  Did they give any hint to a "failover" folder?  No, they didn't.  But I do in my procedure.
    Fourthly, they are saying as if the file name has to be "TXTUTF-8.txt", but actually we can call it whatever we like.  But smart people would have figured this out at the end.
    5 (I'd stop saying fifthly and so on LOL) I'm not sure it's necessary (or recommended) to change "fSavePageSettings" & "fSaveWindowPositions" DWORD values for Notepad as "advised" in that answer.
    As a side-note, I don't know what
    http://www.pc1news.com/saving-changes-to-notepad-configuration-1216.html is supposed to give but when I open this, I got some uTorrent warning.  Really seems like some malware webpage which tries to deceive people!
    I actually searched how a (generic) new file is created and started from there.
    So, maybe next time when you want to criticize or discredit somebody else, try to be more expert first? ;)

  • Writing files in UTF-8 format

    Hi,
    Our system is unicode enable and I want to write a file in UTF-8 format.
    I'tried  the following syntax.
    OPEN DATASET l_filename FOR OUTPUT IN TEXT MODE ENCODING UTF-8.
    and OPEN DATASET l_filename FOR OUTPUT IN TEXT MODE ENCODING default
    But when I check the file, it is in ANSI format. Is there a way we can force the system to write it in UTF-8 format?
    Thanks,
    Ramesh

    Hi Ramesh,
    You could try to use the following coding:
    *& Report ZUS_SDN_UC_XML_TO_UTF8_TRANSF
    REPORT zus_sdn_uc_xml_to_utf8_transf.
    define local data
    CONSTANTS:
    gc_encoding TYPE string VALUE 'UTF-8'.
    DATA:
    gd_result type string,
    go_ixml TYPE REF TO if_ixml,
    go_stream_factory TYPE REF TO if_ixml_stream_factory,
    go_encoding TYPE REF TO if_ixml_encoding,
    go_resstream TYPE REF TO if_ixml_ostream.
    DATA:
    gt_knb1 TYPE STANDARD TABLE OF knb1,
    gd_xml TYPE string,
    gt_xml TYPE TABLE OF string.
    START-OF-SELECTION.
    SELECT * FROM knb1 INTO TABLE gt_knb1 UP TO 10 ROWS
    WHERE bukrs = '1000'.
    go_ixml = cl_ixml=>create( ).
    go_stream_factory = go_ixml->create_stream_factory( ).
    go_encoding = go_ixml->create_encoding( character_set = gc_encoding
    byte_order = 0 ).
    go_resstream =
    go_stream_factory->create_ostream_cstring( gd_result ).
    CALL METHOD go_resstream->set_encoding
    EXPORTING
    encoding = go_encoding.
    XML Transformieren
    CALL TRANSFORMATION id_indent
    SOURCE itab = gt_knb1
    RESULT XML go_resstream.
    APPEND gd_result TO gt_xml.
    CALL METHOD cl_gui_frontend_services=>gui_download
    EXPORTING
    BIN_FILESIZE =
    filename = 'C:\temp\xml_to_utf8.txt'
    FILETYPE = 'ASC'
    APPEND = SPACE
    WRITE_FIELD_SEPARATOR = SPACE
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = SPACE
    WRITE_LF = 'X'
    COL_SELECT = SPACE
    COL_SELECT_MASK = SPACE
    DAT_MODE = SPACE
    CONFIRM_OVERWRITE = SPACE
    NO_AUTH_CHECK = SPACE
    CODEPAGE = SPACE
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = SPACE
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    IMPORTING
    FILELENGTH =
    CHANGING
    data_tab = gt_xml
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    not_supported_by_gui = 22
    error_no_gui = 23
    OTHERS = 24.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    END-OF-SELECTION.
    However, I like to mention that the file created from out ECC 5.0 (6.40, non-Unicode) contains a special character between the XML header and the data part (when displayed using NotePad Editor):
    ...xml version="1.0" encoding="utf-8"?>[special character]<asx:abap xmlns:asx="http://www.sap.com/a...
    Using a HexEditor the special character (0x0A) is displayed as a dot.
    Also Check with FM - TREX_TEXT_TO_UTF8
    Regards,
    KK

  • "error opening file" on html files

    I have an existing site with several html files that edge code displays an "error opening file... the file could not be read" alert on. These html files display fine, and open in my other text/html editors.

    Yep -- unfortunately it's a known issue that Edge Code and Brackets don't support encodings other than UTF-8 yet.  Please add your vote here: https://trello.com/c/DShzQztM/731-support-non-utf-8-encodings
    - Peter

  • Opening files using a script...

    Every time I use the "open" command in applescript, I get the message "cannot get file." How do I open files with a script?

    Your usage of documents folder in this case is incorrect. They are reserved words, but as part of *Standard Additions'* path to command. The Finder is expecting a file path, so try this instead:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    tell application "Finder"
    open every document file of (path to documents folder) whose name contains searchtext
    --where searchtext is text input from the user
    end tell
    </pre>

Maybe you are looking for

  • How to change the default text style?

    The MacOS system seems to maintain a collection of text 'styles' available in applications such as TextEdit, Bean, MacJournal, Notebook and DevonThink. This collection contains a default style, used by some (but not all) of these applications as the

  • Unknown characters being displayed while Printing Bill of Lading(BOL)

    Hello all,    From SAP 4.7D, while printing the output using SAP-script for Bill of Lading, some unknown characters(Eg: 10H0O0S0G), a combination of letters and numbers being printed in the begining and also in the bottom of the output document. This

  • Jagged Edges and Unstable Images when converting from Image Sequence to DV

    Hi, I have an Image Sequence (very good quality) that I'm trying to convert using Graphic Converter into DV NTSC Video. I chose Progressive scan. I find that the Images appear to have Jagged Edges especially when there is movement involved. Also, the

  • WRP400 hangs in off hook state

    Hello, we have a client which uses WRP400 for T.38 faxing.  It has modem connected to FXS port. Usually every 2weeks WRP400 hangs in 'off hook' state for that FXS port and no reboot helps to fix that. Only after firmware rewrite line hook gets in pla

  • Problème d'acquisition labVIEW

    Bonjour (Nouveau utilisateur LabVIEW) Je suis en train de récupérer des signaux des capteurs, avec une carte 6024E. Mon problème est avec labVIEW, je trouve des valeurs différentes  entre le DAQ Assistant  et le DAQmx  après l'acquisition. La différe