German Umlaut in CSV export on mac os

Hello,
i have problems with the csv export when i use an apple mac. German Umlaute are not displayed correctly, neither when i open the .csv file with TextApp nor when i open it with Numbers from iWork.
On a windows machine all is fine. Excel and every text editor i tried opens the file fine with the umlaute displaying correct.
The application is set to automatically encode the csv and application language is set to german.
Is there any other setting that i can change to get a correct csv export on an apple mac?
Apex version is 4.0.2.00.07, Oracle version is 11.2.0.1.0.
Thanks for help in advance,
Dirk

Hi Dirk,
Most likely, the Automatic CSV encoding attribute is set to 'Yes' for your application. If you're running your application in German, then the CSV file will be encoded in WE8MSWIN1252.
Can you try setting Automatic CSV Encoding to "No" (in the Globalization attributes of your application)? The CSV file will then be encoded in UTF-8 - which means that your Windows users may not open it directly but, instead, have to do a data import and specify utf-8 character set.
Joel

Similar Messages

  • German umlauts not supported in CSV file export of campaigns

    Hi all,
    I just customized and tested exporting business partner data out of a marketing campaign to a CSV file. I created a mail form and made the appropriate customizing settings in SPRO.
    All worked fine, but when opening this file with MS EXCEL, german umlauts (ä, ö, ü, ß) cannot be depicted correctly.
    I figured out so far, that my file in encoded in UTF-8.
    Does anybody know if there are some settings to be made in SAP and/or Excel to solve the problem with the umlauts?
    Any help is appreciated!
    Thanks a lot.
    Best regards
    Wolfgang

    Hi Wolfgang,
    I had the same problem as well. This is the solution suggested by SAP Support:
    Unfortunately this is a problem with Microsoft Excel. It is not able to
    handle the UTF-8 format file directly. Please try the following steps
    and check whether the data is displayed correctly -
    1) Download the file to your local system
    2) Open a worksheet in Excel
    3) choose 'Data->Import External Data -> Import Data' from the menu
    4) Then select the file and import it.
    Please remember to set the encoding of the file as UTF8
    Regards, stephan

  • Numbers don't show german umlaut but quick view does

    I do have a problem opening CSV files in Numbers.
    I have a shared folder with VirtualBox. The virtual HD is formatted in FAT32. With Windows I created a CSV file which contains german umlauts like ÄÖÜ.
    When I open the CSV with the "quick view" (press space when file is selected in finder, the CSV is displayed as a nice Table and all Umlauts are OK.
    When I double click the CSV file to open it in Numbers, the Umlauts are not displayed. Opening in Text Edit is the same result, no Umlauts.
    ö = ^
    ß = fl
    ü = ¸
    ä = ‰
    I think this is an encoding problem, but why is "quick view" displaying it correct. I'm confused.
    Thanks for any help.

    Hello
    I cannot find any encoding settings for opening files in Numbers 09.
    A simple and obvious solution would be to save CSV file in UTF-8 in FAT32 volume in VirtualBox if possible.
    One other method is to copy the CSV file to HFS+ volume and set its extended attributes to specify its text encoding. This method is only changing the metadata of the file and so is less intrusive than to convert the data itself to different text encoding. When text encoding extended attribute is properly set, Numbers 09 (and TextEdit.app set to use "Automatic" encoding option in opening files) will open it in the specified text encoding.
    The following AppleScript script might help to set the extended attributes (OSX 10.5 or later only). Recipe is as follows.
    A1) Open /Applications/Utilities/AppleScript Editor.app, copy the code of set_latin1_xattr.applescript listed below and save it as application (bundle) in the folder where target CSV files reside.
    A2) Double click the saved applet and it will set the com.apple.TextEncoding extended attribute of the *.csv and *.txt files in the same folder where the applet resides to Latin 1 when they are recognised as 'ISO-8859 text' by file(1) command.
    -- set_latin1_xattr.applescript
    _main()
    on _main()
        set p2m to (path to me)'s POSIX path
        if p2m ends with "/" then set p2m to p2m's text 1 thru -2
        set sh to "
    # set current directory to parent directory of script (or die)
    cd \"${0%/*}\" || exit 1
    # add com.apple.TextEnncoding xattr for Latin-1
    # for *.csv and *.txt files, of which file info contains 'ISO-8859 text', in current directory
    for f in *.{csv,txt}
    do
        if [[ $(file \"$f\") =~ 'ISO-8859 text' ]]
        then
            xattr -w com.apple.TextEncoding \"WINDOWS-1252;$((0x0500))\" \"$f\"
        fi
    done
        do shell script "/bin/bash -c " & sh's quoted form & " " & p2m's quoted form
    end _main
    Another method is to convert the text encoding itself as you have already done using TextEdit.app.
    The following AppleScript might help to convert text encoding from latin-1 to utf-8 in bulk. Recipe is basically the same as the above.
    B1) Open /Applications/Utilities/AppleScript Editor.app, copy the code of convert_latin1_to_utf8.applescript listed below and save it as application (bundle) in the folder where target CSV files reside.
    B2) Double click the saved applet and it will convert the text encoding of the *.csv and *.txt files in the same folder where the applet resides to UTF-8 when they are recognised as 'ISO-8859 text' by file(1) command. Also it sets the extended attribute for text encoding accordingly.
    -- convert_latin1_to_utf8.applescript
    _main()
    on _main()
        set p2m to (path to me)'s POSIX path
        if p2m ends with "/" then set p2m to p2m's text 1 thru -2
        set sh to "
    # set current directory to parent directory of script (or die)
    cd \"${0%/*}\" || exit 1
    # make temporary directory
    temp=$(mktemp -d /tmp/\"${0##*/}\".XXXXXX) || exit 1
    # convert text encoding from ISO-8859-1 to UTF-8
    # for *.csv and *.txt files, of which file info contains 'ISO-8859 text', in current directory
    for f in *.{csv,txt}
    do
        if [[ $(file \"$f\") =~ 'ISO-8859 text' ]]
        then
            iconv -f ISO-8859-1 -t UTF-8 \"$f\" > \"$temp/$f\" \\
            && xattr -w com.apple.TextEncoding \"UTF-8;$((0x08000100))\" \"$temp/$f\" \\
            && mv -f \"$temp/$f\" \"$f\"
        fi
    done
    # clean up temporary directory
    rm -rf \"$temp\"
        do shell script "/bin/bash -c " & sh's quoted form & " " & p2m's quoted form
    end _main
    Note that the extended attribute is not supported in FAT32 and so the above methods only work in HFS+ formatted volume.
    Scripts are briefly tested with Numbers 2.0.5 under OSX 10.5.8 and 10.6.5. Please make sure you have backup CSV files before applying the above scripts.
    Good luck,
    H

  • German umlauts :Sender File Adapter

    Hi,
    I am trying to configure Sender File adapter,but it is not working properly for German umlauts.
    I have tried encoding UTF-8, UTF-16, ISO-8859-1,ISO-8859-2, ISO-8859-5 but none of them are working.
    Can anyone please help me out in this.
    Thanks a lot.
    Regards,
    Shweta

    Hi Stefan,
    I have already added this module exactly in the same way.
    But can you please confirm the sequence
    Module :
    localejbs/AF_Modules/PayloadSwapBean                     Local Enterprise Bean     swap
    localejbs/AF_Modules/MessageTransformBean     Local Enterprise Bean     Transform
    localejbs/AF_Modules/MessageTransformBean     Local Enterprise Bean     Transform
    Transform.ContentType                     text/plain;charset="UTF-8"
    Transform.ContentDisposition            attachment;filename="ABC.csv"
    Also,I noticed one thing
    The content is corrupted in SXI_MONITOR but it is correct in payload of File as well as Mail adapter in Message Monitor(RWB)
    Thanks.
    Regards,
    Shweta

  • German Umlauts OK in Test Environment, Question Marks (??) in production

    Hi Sun Forums,
    I have a simple Java application that uses JFrame for a window, a JTextArea for console output. While running my application in test mode (that is, run locally within Eclipse development environment) the software properly handles all German Umlauts in the JTextArea (also using Log4J to write the same output to file-- that too is OK). In fact, the application is flawless from this perspective.
    However, when I deploy the application to multiple environments, the Umlauts are displayed as ??. Deployment is destined for Mac OS X (10.4/10.5) and Windows-based computers. (XP, Vista) with a requirement of Java 1.5 at the minimum.
    On the test computer (Mac OS X 10.5), the test environment is OK, but running the application as a runnable jar, german umlauts become question marks ??. I use Jar Bundler on Mac to produce an application object, and Launch4J to build a Windows executables.
    I am setting the default encoding to UTF-8 at the start of my app. Other international characters treated OK after deployment (e, a with accents). It seems to be localized to german umlaut type characters where the app fails.
    I have encoded my source files as UTF-8 in Eclipse. I am having a hard time understanding what the root cause is. I suspect it is the default encoding on the computer the software is running on. If this is true, then how do I force the application to honor german umlauts?
    Thanks very much,
    Ryan Allaby
    RA-CC.COM
    J2EE/Java Developer
    Edited by: RyanAllaby on Jul 10, 2009 2:50 PM

    So you start with a string called "input"; where did that come from? As far as we know, it could already have been corrupted. ByteBuffer inputBuffer = ByteBuffer.wrap( input.getBytes() ); Here you convert the string to to a byte array using the default encoding. You say you've set the default to UTF-8, but how do you know it worked on the customer's machine? When we advise you not to rely on the default encoding, we don't mean you should override that system property, we mean you should always specify the encoding in your code. There's a getBytes() method that lets you do that.
    CharBuffer data = utf8charset.decode( inputBuffer ); Now you decode the byte[] that you think is UTF-8, as UTF-8. If getBytes() did in fact encode the string as UTF-8, this is a wash; you just wasted a lot of time and ended up with the exact same string you started with. On the other hand, if getBytes() used something other than UTF-8, you've just created a load of garbage. ByteBuffer outputBuffer = iso88591charset.encode( data );Next you create yet another byte array, this time using the ISO-8859-1 encoding. If the string was valid to begin with, and the previous steps didn't corrupt it, there could be characters in it that can't be encoded in ISO-8859-1. Those characters will be lost.
    byte[] outputData = outputBuffer.array();
    return new String( outputData ); Finally, you decode the byte[] once more, this time using the default encoding. As with getBytes(), there's a String constructor that lets you specify the encoding, but it doesn't really matter. For the previous steps to have worked, the default had to be UTF-8. That means you have a byte[] that's encoded as ISO-8859-1 and you're decoding it as UTF-8. What's wrong with this picture?
    This whole sequence makes no sense anyway; at best, it's a huge waste of clock cycles. It looks like you're trying to change the encoding of the string, which is impossible. No matter what platform it runs on, Java always uses the same encoding for strings. That encoding is UTF-16, but you don't really need to know that. You should only have to deal with character encodings when your app communicates with something outside itself, like a network or a file system.
    What's the real problem you're trying to solve?

  • Mail Adapter - PayloadSwapBean - MessageTransformBean - German umlauts

    Hi there,
    I'm receiving mails with an attachment (.csv / .txt) that I want to process to get IDocs. Everything works fine but the conversion of German umlauts. I tried to apply several charsets (i.e. iso-8859-1, iso-8859-2, utf-8) in the contentType parameter without success. The result in my payload after swapping and transforming is a message without umlauts. All these characters have been replaced by the same 'character' that looks like a quadrangle. Therefore even the earliest possible mapping comes too late to convert this character back into umlauts, because I don't know anymore the original ones.
    When I process the same attachment with a <u>file</u> <u>adapter</u> in the same manner (until getting an IDoc) there are no problems with umlauts, the payload looks fine!
    I even checked the note 881308 (although it's said to be for the mail receiver) but it's already in the system (XI 3.0, SP 14)
    Anyone an idea to solve my problem?
    Regards,
    Ralph

    Hi Ralph,
    now I got the solution:
    Allpy the MessageTransformBean twice.
    First you set the code page for the mail attachment, how it comes to the system.
    Then you do the conversion and set the code page how the target xml should be.
    Make two entries in Module configuration:
    localejbs/AF_Modules/MessageTransformBean - contenttype
    localejbs/AF_Modules/MessageTransformBean - tranform
    as paramters you set:
    contentType - Transform.ContentType - text/plain; charset=iso-8859-1
    transform     - Transform.ContentType - text/xml; charset=UTF-8
    transform     - Transform.Class           - com.sap.aii.messaging.adapter.Conversion
    and so on.
    The problem is that outlook does not provide the content type for the attachment, so the MailTransformBean assumes UTF-8, but the attachment has iso-8859-1, so you have to set this before the conversion.
    I have tested this with XI 3.0 SP17 with note 960501 included.
    Regards
    Stefan

  • Howto set up proper utf-8 locales and german umlaute?

    Hi there,
    have some issues here and i think it has something to do with my locales... I have them since one of the last updates i think...
    First problem:
    In Kopete, i can send the german "umlaute" (ä, ö, ü) to others and they are sent and displayed correctly at their side... But when they send me these characters, i get only a square and a deleted next-letter-in-the-word by them. This happens with every theme and font combination in kopete. Here is an example:
    Second problem:
    In Konsole, the "umlaute" are correctly displayed on my folders, but in the messages i get the chars are simply deleted and not visible. This happens in the VC and in Xorg too. Here is another example:
    (It should mean "Keine Handbuch Seite für pacman.conf")
    My config:
    I think i have configured my System properly, well at least i hope that Here are the relevant parts of my config files:
    /etc/rc.conf:
    LOCALE="de_DE.utf8"
    KEYMAP="de"
    CONSOLEFONT=
    CONSOLEMAP=
    /etc/profile:
    export LANG="de_DE.utf8"
    export LANGUAGE="de_DE.utf8"
    /etc/locale.gen:
    de_DE.UTF-8     UTF-8
    en_US.UTF-8     UTF-8
    And "locale -a" gives me:
    C
    POSIX
    de_DE.utf8
    en_US.utf8
    The fonts I use:
    KDE GUI: Bitstream Vera Sans (everywhere)
    Y-Terminal (Konsole) Font: Bitstream Vera Sans mono
    So, how can i configure a proper german utf-8? I have already searched the forums (both here and the DE one) and the wiki, but found no solution to this....
    THX
    Funkyou

    Thx for the suggestions, but none of them seems to solve it...
    baze:
    This line was already uncommented and i have generated my locales for several times now... I have updated my post with the uncommented lines in /etc/locale.gen, just to collect all information...
    Romashka:
    Ok, but what if the two variables contain the same content? I mean, when i define LANG="de_DE.utf8" in /etc/profile and it is then overwritten by /etc/profile.d/lang.sh with LANG="de_DE.utf8", then this is simply the same variable defined twice with the same content... I have tried to unset the one in /etc/profile, but it did not solve it...
    As for CONSOLEFONT, i had never one defined, can anyone suggest me a proper one? And the other question is: Its not working on the terminals, but it is also not working in Xorg, so is this really a CONSOLEFONT issue?
    I have tried another thing and switched my locales to de_DE@euro     ISO-8859-15, and with this setting the chars appear correctly... But i cannot be the only one where it does not work, i feel so excluded without UTF-8
    Have also tried another terminal in Xorg... In XTerm the chars are not deleted like in Kopete or on the VC, but i see an inverted question mark instead of them...

  • Keychains bug with german umlaut

    Recently i found a strange behavior within keychains. If the name of a keychain contains a german umlaut e.g "geschäftlich" i'm not able to activate sync keychain with .mac. i set the marker at "sync keychain with .mac" and click save. When i open the keychain settings again the dotmac setting is again NOT enabled and the keychains don't get synced.
    If i make a new keychain "geschaeftlich" which contains the same items as "geschäftlich" everything works fine.
    As far as i remember keychains worked with "umlaute" until at least 10.5.2

    Probably one of many issues with the transition to MobileMe. I'd file a bug.

  • German Umlauts in helptext displayed as rectangle

    Background
    Upgrading Apex from 3.2.x to 4.0.2.00.07
    Problem
    Apex running in German. The tests look normal ( German Umlauts looks correct)
    Only customized helptext or standard help text will display the Umlauts as rectangles.
    Load_de.sql was running corrctly
    On Apex.oracle.com -> The issue also not reproduceable
    If set: Set Screen Reader Mode On = on
    it works too?
    Environment
    ApEx 4.0.2.00.07 on linux 64-bit on a 11.1.1.0.7 database
    Client: XP SP3 IE 8
    Any ideas?
    Perhaps similar issues in other languages like French or so?
    Thanks Hendrik

    Did you look at the character set when you exported your application from the 3.2 environment?
    Did you import it into the 4 environment using the same character set?

  • Desktop.open() fails when file contains German umlauts

    Hello,
    I want to open a file using the Desktop-API:
    // check whether opening a file is supported or not
    if (!desk.isSupported(Desktop.Action.OPEN)) {
      // display error message box
      JOptionPane.showMessageDialog(getFrame(),getResourceMap().getString("errLinkUnsopportedMsg"),
             getResourceMap().getString("errLinkUnsopportedTitle"),JOptionPane.ERROR_MESSAGE);
      return;
    desk.open(linkfile);I'm catching all possible exceptions here:
                 catch (IOException e)
                catch (IllegalArgumentException e)
                catch (SecurityException e)
                catch (UnsupportedOperationException e)
                catch (URISyntaxException e)But when I want to open a file that contains German umlauts, my application throws following exception:
    Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException:
    Non-Java exception raised, not handled!
    (Original problem: *** -[NSCFArray initWithObjects:count:]:
    attempt to insert nil object at objects[0])
    at apple.awt.CDesktopPeer._lsOpen(Native Method)
    at apple.awt.CDesktopPeer.lsOpen(CDesktopPeer.java:53)
    at apple.awt.CDesktopPeer.open(CDesktopPeer.java:33)
    at java.awt.Desktop.open(Desktop.java:254)
    at zettelkasten.ZettelkastenView.eventHyperlinkActivated(ZettelkastenView.java:9609)
    at zettelkasten.ZettelkastenView.access$6000(ZettelkastenView.java:119)
    at zettelkasten.ZettelkastenView$14.hyperlinkUpdate(ZettelkastenView.java:7014)The file does definitely exist. I chose it with a filechooser, and I debugged the source step-by-step. Before calling the desktop.open() command, I check whether the file exists or not (File.Exists()).
    When I open any file without umlauts, everything is fine. Only files with umlauts in their filename seem to make trouble.
    My OS is:
    Mac OS X 10.5.5, running the latest Java 6, using NetBeans 6.5
    Is there any solution, or at least a workaround?
    Thanks in advance!
    Daniel
    Edited by: DnlLdck on Jan 29, 2009 6:23 AM

    Same thing happened to me, but I was trying to browse an URI which contains non-English characters. Haven't try it on Windows yet. Maybe it does not support non-English characters on Mac.

  • [solved] grep german umlaut using regex? use iconv

    Hi guys,
    when grepping
    "<condition data="Bewölkt"/><temp_f data="45"/>"
    i don't get any output.
    The same grep sequence works fine for words like "Leichter Regen" or "Klar", so i suspect grep fails because of the german umlaut ("ö" in this case).
    Now, this is my current locale:
    LANG=en_US.UTF-8
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=
    If i export LC_ALL=de_DE i no longer get 0 output but rather "Bew" instead of "Bewölkt" or "Meistens" instead of "Meistens bewölkt".
    Any ideas how to teach grep to use iso-8859-15 or something like that?
    Here's the relevant part of the function:
    declare -a wetter
    wetter=(`curl -silent "http://www.google.de/ig/api?weather=$1+$2+$3" | grep -o 'condition data=\"[A-Z].*\"/><temp_f' | grep -o '[A-Z][a-z]*'`)
    echo Wetter: $wetter
    Last edited by demian (2010-04-27 16:47:26)

    Yes, i was just now getting into regular expressions and sed so my functions will be very dirty for the time being . I'll try the sed command though, thank you.
    I tried iconv as well as your suggestions but the problem remains.
    When i save the .xml file on my hard drive i can grep "bewölkt" but not when i use curl to view the data. When i use curl grep simply ignores everything after the umlaut:
    curl -silent "http://www.google.de/ig/api?weather=Berlin" | grep -o 'condition data=\"[[:alpha:]]*.*'
    condition data="Meistens bew
    condition data="Wind: W mit Windgeschwindigkeiten von 23 km/h"/>[...]
    Maybe the problem is that i don't seem to have iso8895* locales.
    > fd /usr en_US
    /usr/lib/tupac/localization/en_US.php
    /usr/share/X11/locale/en_US.UTF-8
    /usr/share/X11/locale/en_US.UTF-8/Compose
    /usr/share/X11/locale/en_US.UTF-8/XI18N_OBJS
    /usr/share/X11/locale/en_US.UTF-8/XLC_LOCALE
    /usr/share/i18n/locales/en_US
    /usr/share/locale/en_US
    /usr/share/locale/en_US/LC_MESSAGES
    /usr/share/locale/en_US/LC_MESSAGES/wget.mo
    /usr/share/vim/vim72/spell/en/en_US.diff
    > fd /usr de_DE
    /usr/lib/tupac/localization/de_DE.php
    /usr/share/i18n/locales/de_DE
    /usr/share/i18n/locales/de_DE@euro
    /usr/share/vim/vim72/lang/menu_de_de.latin1.vim
    /usr/share/vim/vim72/lang/menu_de_de.utf-8.vim
    /usr/share/vim/vim72/spell/de/de_DE.diff
    Sorry, I've never localized the system before. I always found it convenient just to stick with en_US.utf8 until now.
    I've already changed the function to use google.com so i don't have the umlaut-problem anymore.
    Regards,
    demian
    Last edited by demian (2010-04-27 10:04:31)

  • How to add German Umlaut to iWeb?

    Hi,
    My default language on my site is English. But I want to add German Umlauts to a word. I copied and pasted it from a German site, but Google doesn't recognize the word.
    So, is there a way to insert other language characters and still get word recognition by Google?
    Thanks
    Lars

    Hi, my website is http://www.ethnicyum.com/
    On the Welcome.html page I am using the word Schwarzwälder Kirsch Torte. The US Google only recognizes Schwarzw as a keyword, but not the entire word.
    I used the Keyboard Viewer on the Mac to insert the ä. Is there another way to do it so that Google recognizes the word?

  • Multiple CSV exports from the one button or pl/sql procedure?

    I need to have multiple csv exports from the one press of a button. The easiest way I found to do this is it to use javascript to popup three windows, each as a CSV link. This is a bit ugly though, and leaves the browser popup windows open when the file has been downloaded.
    I guess I could also make a solution based on branching, but I think that would be difficult to maintain and reeks of bad design (im not a fan of this spagetti GOTO style code!).
    I implemented Scott's custom CSV as found here: http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html
    However I would like to know if its possible to download more than one file using this method. I could not work out how to do this .
    Has anyone got any ideas? Simply repeating the code puts the second table into the original csv file. Is there a way to 'reset' the htp writer or smoething?
    Any help greatly appreciated,
    Alex

    Sorry for the confusion - I guess I mean its easy in .NET because you can simply compress files together and then send 1 zip file down as the response. See http://www.developer.com/net/net/article.php/11087_3510026_2 for details.
    I guess I could ask how to do this in APEX - but it seems to me that my original wording addresses the concept at a much more abstract level. I may not find the best solution for my problem if I just asked 'how can I dynamically zip together three tables as seperate files and send them to the client?'. I also suspect that this method is not possible in APEX without custom packages. Please prove me wrong!
    I guess even if I could find some kind of javascript that didnt open a new window, but was a direct download to the CSV, that would be a good compromise. At the moment when you click on the link, three windows come up and stay blank until the files are ready for downloading. Then after the files have been downloaded the windows must be shut manually. Yes, I could use javascript to make the windows 1x1 pixel perhaps, and then shut them after a predetermined timeframe - but this is hardly an elegant solution!
    Thanks for your responses.

  • High performance CSV export

    Hi,
    I have been looking for a way to export huge datasets to CSV format for import with MySql.
    As sqlplus SPOOL turned out to be slow and difficult to use, I ended up coding my own importer using the OCCI library.
    I successfully compiled my code under Red Hat Enterprise Linux 6, 64 bit, and Oracle Instant Client 12.1. But as it only uses C++ STL and OCCI, it should as well build under other environments (e.g. Windows).
    Here's the code:
    * ociexport.cpp - High performance ORACLE to CSV export (using OCCI and STL)
    * This program takes the ORACLE connection information from the following
    * environment variables:
    * ORACLE_USER, ORACLE_PASS, ORACLE_CONN
    * Fields are exported in a CSV with delimiter ';'. Semicola within the fields
    * are escaped with '\;'. Newlines and tabs in the fields are replaced by blanks.
    * Empty fields and NULL values are exported as '\N' for easy MySQL import.
    * CLOBS are exported as well. BLOBS and BFILES are not supported atm.
    * Don't forget to set the LD_LIBRARY_PATH to your Oracle Client libs when
    * building and running this program.
    * @param $1 Select-Statement
    * @param $2 Output file (optional - if empty, output goes to stdout)
    * @author Bert Klauninger
    * @version 0.1.0
    * @changelog
    *    2013-12-13 - Created
    *    2013-12-16 - Added CLOB streaming support
    #include <cstdlib>
    #include <cstring>
    #include <fstream>
    #include <iostream>
    #include <string>
    #include <vector>
    #include "occi.h"
    using namespace oracle::occi;
    using namespace std;
    #define BUFFER_SIZE        1024                        // Maximal characters of a LOB to be exported
    * Escape all occurrences of ';' and convert newlines and tabs to blanks
    string csv_escape(string src) {
        string result;
        const int imax = src.length();
        for (int i = 0; i < imax; ++i) {
            switch (src[i]) {
                case '\n':
                case '\r':
                case '\t':
                    result += ' ';
                    break;
                case ';':
                    result += '\\';
                    result += ';';
                    break;
                default:
                    result += src[i];
        return result;
    * Execute a query and write CSV to the given file.
    *    NB: Empty fields are exported as NULL values!
    void select_into(Connection *con, string sql, string file) {
        if (! con) {
            return;
        bool fo = ! file.empty();
        ofstream o;
        if (fo) o.open(file.c_str(), ofstream::out);
        Statement *s = con->createStatement(sql);
        ResultSet *r = s->executeQuery();
        vector<MetaData> m = r->getColumnListMetaData();
        const int cols = m.size();
        if (fo) cout << "Result has " << cols << " cols" << endl;
        int cnt = 0;
        while (r->next()) {
            string line;
            ++cnt;
            /* Stupid ORACLE starts numbering at 1, not 0 */
            for (int i = 1; i <= cols; ++i) {
                string col;
                /* ...but: Metadata vector starts at 0 */
                int t = m[i - 1].getInt(MetaData::ATTR_DATA_TYPE);
                if (t == OCCI_SQLT_CLOB) {
                    /* Get the CLOB object via stream */
                    Clob clob = r->getClob(i);
                    if (! clob.isNull()) {
                        clob.open(OCCI_LOB_READONLY);
                        int len = clob.length();
                        Stream *instream = clob.getStream();
                        char *buffer = new char[BUFFER_SIZE];
                        memset(buffer, 0, BUFFER_SIZE);
                        int r = 0;
                        do {
                            r = instream->readBuffer(buffer, len);
                            for (int i = 0; i < r; ++i) {
                                col += (char) buffer[i];
                        } while (r != -1);
                        delete[] buffer;
                        clob.closeStream(instream);
                        clob.close();
                } else if (! r->isNull(i)) {
                    /* Try to get field value as string */
                    col = r->getString(i);
                if (col.empty()) {
                    line += "\\N";
                } else {
                    line += csv_escape(col);
                if (i < cols) {
                    line += ';';
            if (fo) {
                o << line << endl;
            } else {
                cout << line << endl;
        s->closeResultSet(r);
        con->terminateStatement(s);
        if (fo) cout << cnt << " rows exported" << endl;
    /*** MAIN ***/
    int main (int argc, char* argv[]) {
        if (! (argc == 2 || argc == 3)) {
            cerr << "Usage: " << argv[0] << " sql-statement [output-file.csv]" << endl << endl;
            cerr << "Output file uses column separator ';'. Semicola are escaped using '\\;'." << endl;
            cerr << "NULL values and empty fields are exported as '\\N'." << endl;
            cerr << "If no output file is specified, quieted output is sent to stdout." << endl;
            cerr << "Login credentials can be set via the following environment variabes:" << endl;
            cerr << "ORACLE_USER, ORACLE_PASS, ORACLE_CONN" << endl << endl;
            return 1;
        const string user = getenv("ORACLE_USER");
        const string pass = getenv("ORACLE_PASS");
        const string osid = getenv("ORACLE_CONN");
        const string sql = argv[1];
        const string outfile = (argc == 3) ? argv[2] : "";
        bool fo = ! outfile.empty();
        Environment* env = Environment::createEnvironment(Environment::DEFAULT);
        int ret = 0;
        try {
            if (fo) cout << "Connecting as " << user << "@" << osid << endl;
            Connection* const con = env->createConnection(user, pass, osid);
            if (fo) {
                cout << "Executing query " << sql << endl;
                cout << "Writing results to " << outfile << endl;
            select_into(con, sql, outfile);
            if (fo) cout << "Closing connection" << endl;
            env->terminateConnection(con);
        } catch (SQLException ea) {
            cerr << "Error: " << ea.what();
            ret = 1;
        Environment::terminateEnvironment(env);
        return ret;
    My Makefile:
    ociexport: ociexport.cpp
            LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib \
                    gcc -Wall -g -I /usr/include/oracle/12.1/client64 \
                    -L /usr/lib/oracle/12.1/client64/lib \
                    -o bin/ociexport ociexport.cpp \
                    -lclntsh -lnnz12 -locci
    Program call:
    $ export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib
    $ export ORACLE_USER=your_user
    $ export ORACLE_PASS=your_pass
    $ export ORACLE_CONN=your_connection_string
    $ ./ociexport "SELECT * FROM applications" > export.csv
    Best regards
    Bert

    Hi
    Give a look to the following book. You'll find the answer for some questions...
    http://www.theserverside.com/books/masteringEJB/index.jsp
    Chris

  • German Umlaute don't work after upgrading to Yosemite with Japanese Romaji Layout set on U.S.

    Hi everyone,
    previously i could just use [ALT] + [U] and then press [A] / [a] / [U] / [u] / [O] / [o] to generate the german umlaut version.
    After installing Yosemite this does not work anymore, which is kinda frustrating. Cause it forces me to add another keyboard layout and switch when i have to write a german umlaut.
    I was previously using 'Input Source' > 'Japanese' > Enabled Romaji (Romaji layout was set to U.S.) & Hiragana.
    For testing purpose i added the Standard U.S. Layout and writing the Umlaut with the keyboard shortcut still works there. So that's why i think this is a Romaji specific bug.
    Has anyone any idea what's wrong ? Did Apple change something ?
    Best Regards

    Before I stumbled upon this thread, there was no flag at all. I had the character viewer there because pre-Yosemite it was the only way to access emoji (and things like arrows and other special symbols) in many apps (and still is for my Adobe CS5 apps). Additionally, I would use the keyboard viewer from time to time as a way to learn which keys to use for other special symbols (bring up the keyboard viewer and press option or shift-option or other combinations and it would show you a preview of what each key would generate).
    While reading this thread, I added more input sources (US International and US Extended) and would see the flags. The flags replaced the previous character/keyboard viewer menu icon. I switched between each flag to test my issue under each, to no avail.  Then I tried adding the Spanish keyboard but still had the same issue.
    Now I've removed all the input sources except the primary US keyboard. There is no longer a flag in my menu, it's gone back to the character viewer icon.
    The issue is still there. When I type option-r, u, or g, in any app nothing happens at all.
    Unfortunately, neither auto-substitution nor press-and-hold work in Adobe CS5 apps, which is where I need to use these special characters the most.
    Thank you for reaching out

Maybe you are looking for