Search code examples
sybasebcp

Getting ? while bcp out data from sybase with umlaut character(¬)


I am trying to bcp out data from Sybase to .bcp file. while doing bcp (¬) character alone getting displayed as '?'. Any suggestion?


Solution

  • It could be that your bcp utility is not using the same charset as your database or the terminal. You may have to play with the bcp options that will to force the output to match what you need.

    Here are the flags:

    [-a display_charset]
    [-z language]
    [-J client_charset]
    

    SAP/Sybase ASE Utility Guide: bcp

    -a display_charset

    allows you to run bcp from a terminal where the character set differs from that of the machine on which bcp is running. Use -a in conjunction with -J to specify the character set translation file (.xlt file) required for the conversion. Use -a without -J only if the client character set is the same as the default character set.

    -z language

    is the official name of an alternate language the server uses to display bcp prompts and messages. Without the -z flag, bcp uses the server’s default language.

    You can add languages to an Adaptive Server during installation or afterwards, using either the langinstall utility (or langinst in Windows) or the sp_addlanguage stored procedure.

    -J client_charset

    specifies the character set to use on the client. bcp uses a filter to convert input between client_charset and the Adaptive Server character set.

    -J client_charset requests that Adaptive Server convert to and from client_charset, the character set used on the client.

    -J with no argument sets character set conversion to NULL. No conversion takes place. Use this if the client and server use the same character set.

    Omitting -J sets the character set to a default for the platform, which may not necessarily be the character set that the client is using.

    For more information about character sets and associated flags, see the System Administration Guide.