Loading ...
Sorry, an error occurred while loading the content.

Encoding JayBird on Linux

Expand Messages
  • hugo.larson
    Hello! I have an application which I initially developed on Windows with Firebird 1.5.3 enconding NONE, JayBird 2.1 Now I have poeted it to Linux (Ubuntu) and
    Message 1 of 5 , Jan 3, 2009
    • 0 Attachment
      Hello!

      I have an application which I initially developed on Windows with
      Firebird 1.5.3 enconding NONE, JayBird 2.1
      Now I have poeted it to Linux (Ubuntu) and all is fine except problem
      with the Swedish letters ÅÄÖ. The letters display correctly in Windows
      environment bot NOT in Linux.

      Any ideas?

      Yours,
      Hugo Larson
    • Roman Rokytskyy
      Hi, ... Almost certainly your Linux has different code page compared to the Windows box. This is controlled by the $LANG and/or $LC_CTYPE environment variables
      Message 2 of 5 , Jan 3, 2009
      • 0 Attachment
        Hi,

        > I have an application which I initially developed on Windows with
        > Firebird 1.5.3 enconding NONE, JayBird 2.1
        > Now I have poeted it to Linux (Ubuntu) and all is fine except problem
        > with the Swedish letters ÅÄÖ. The letters display correctly in Windows
        > environment bot NOT in Linux.
        >
        > Any ideas?

        Almost certainly your Linux has different code page compared to the
        Windows box. This is controlled by the $LANG and/or $LC_CTYPE
        environment variables and very often *nixes have it set to ANSI_C...

        If you can't tune those environment variables, set the following
        connection properties:

        encoding=NONE
        charSet=WIN1254

        You can do this also in JDBC URL:

        jdbc:firebirdsql:localhost/3050:/path/to/db.fdb?encoding=NONE&charSet=WIN1254

        But the best way is to go away from NONE.

        Roman
      • hugo.larson
        ... jdbc:firebirdsql:localhost/3050:/path/to/db.fdb?encoding=NONE&charSet=WIN1254 ... Hi Roman Thanks for your reply! I changed the local to Swedish and the
        Message 3 of 5 , Jan 4, 2009
        • 0 Attachment
          --- In Firebird-Java@yahoogroups.com, Roman Rokytskyy <roman@...> wrote:
          >
          > Hi,
          >
          > > I have an application which I initially developed on Windows with
          > > Firebird 1.5.3 enconding NONE, JayBird 2.1
          > > Now I have poeted it to Linux (Ubuntu) and all is fine except problem
          > > with the Swedish letters ÅÄÖ. The letters display correctly in Windows
          > > environment bot NOT in Linux.
          > >
          > > Any ideas?
          >
          > Almost certainly your Linux has different code page compared to the
          > Windows box. This is controlled by the $LANG and/or $LC_CTYPE
          > environment variables and very often *nixes have it set to ANSI_C...
          >
          > If you can't tune those environment variables, set the following
          > connection properties:
          >
          > encoding=NONE
          > charSet=WIN1254
          >
          > You can do this also in JDBC URL:
          >
          >
          jdbc:firebirdsql:localhost/3050:/path/to/db.fdb?encoding=NONE&charSet=WIN1254
          >
          > But the best way is to go away from NONE.
          >
          > Roman
          >

          Hi Roman

          Thanks for your reply!
          I changed the local to Swedish and the variables are changed but it
          did not work.
          I tried to connect with:
          jdbc:firebirdsql:localhost/3050:/path/to/db.fdb?encoding=NONE&charSet=WIN1252
          but the connection was behaving strange and wont show table content.

          Is not WINxxxx Windows specific character set or does it also work
          under linux?

          Thanks,
          Hugo
        • Roman Rokytskyy
          ... Strange. Check the value of the file.encoding property, e.g. by: System.out.println(System.getProperty( file.encoding )) ... Ups! It should be Cp1252, not
          Message 4 of 5 , Jan 4, 2009
          • 0 Attachment
            > I changed the local to Swedish and the variables are changed but it
            > did not work.

            Strange. Check the value of the file.encoding property, e.g. by:

            System.out.println(System.getProperty("file.encoding"))

            > I tried to connect with:
            > jdbc:firebirdsql:localhost/3050:/path/to/db.fdb?encoding=NONE&charSet=WIN1252
            > but the connection was behaving strange and wont show table content.

            Ups! It should be Cp1252, not WIN1252... Sorry...

            Roman
          • hugo.larson
            ... jdbc:firebirdsql:localhost/3050:/path/to/db.fdb?encoding=NONE&charSet=WIN1252 ... It worked! Thanks Roman! Hugo
            Message 5 of 5 , Jan 4, 2009
            • 0 Attachment
              --- In Firebird-Java@yahoogroups.com, Roman Rokytskyy <roman@...> wrote:
              >
              > > I changed the local to Swedish and the variables are changed but it
              > > did not work.
              >
              > Strange. Check the value of the file.encoding property, e.g. by:
              >
              > System.out.println(System.getProperty("file.encoding"))
              >
              > > I tried to connect with:
              > >
              jdbc:firebirdsql:localhost/3050:/path/to/db.fdb?encoding=NONE&charSet=WIN1252
              > > but the connection was behaving strange and wont show table content.
              >
              > Ups! It should be Cp1252, not WIN1252... Sorry...
              >
              > Roman
              >

              It worked! Thanks Roman!

              Hugo
            Your message has been successfully submitted and would be delivered to recipients shortly.