Menu

Encoding issues

jb0502
2013-05-06
2013-12-25
  • jb0502

    jb0502 - 2013-05-06

    I appreciate your work. It is excellent.
    I am having issues with encoding, I see question marks instead of letters.
    I tried props.setProperty("encoding", "Cp1254");
    But it didnt help.
    Thanks in advance

     
  • Mark Rotteveel

    Mark Rotteveel - 2013-05-08

    You need to set the "charSet" property if you want to set the connection characterset using Java character set names. The property "encoding" is used when you want to set the connection characterset using the Firebird name of the characterset (value "WIN1254" in this case).

     
    • jb0502

      jb0502 - 2013-05-09

      Thanks Mark.
      I tried that too, it cant even connect to database.
      When I remove that line, it connects and fetchs with question marks.

       
  • Mark Rotteveel

    Mark Rotteveel - 2013-05-11

    What error do you get on connecting?

     
  • konrads

    konrads - 2013-08-21

    This works fine as:
    Properties ParamConnection = new Properties();
    ParamConnection.setProperty(“user”, “SYSDBA”);
    ParamConnection.setProperty(“password”, “masterkey”);
    // ParamConnection.setProperty(“encoding”, “WIN1251″);

    String sCon = “jdbc:firebirdsql:192.168.0.97/3050:TestDB”;

    // register
    DriverClass.forName(“org.firebirdsql.jdbc.FBDriver”);

    // Get connection
    Connection con = DriverManager.getConnection(sCon, ParamConnection);

    And if you remove the comment in a row
    ParamConnection.setProperty (“encoding”, “WIN1251″)
    An error occurs:
    08-08 02:46:07.225: E / AndroidRuntime (1376): FATAL EXCEPTION: main
    08-08 02:46:07.225: E / AndroidRuntime (1376): java.lang.IllegalStateException: Could not execute method of the activity
    08-08 02:46:07.225: E / AndroidRuntime (1376): at android.view.View $ 1.onClick (View.java: 3599)
    …..
    ….. more

     
  • Christian Mayer

    Christian Mayer - 2013-09-02

    I will look at this. Please try "SET NAMES WIN1251" as a query instead.

     
  • konrads

    konrads - 2013-09-04

    Solved this problem as follows:
    encoding in the connection parameters do not use.

    Reading data from a text field in the database with the encoding 1251:

    old code -
    names[i] = rs.getString (1);

    new code -
    names[i] = new String (rs.getBytes (1), "cp1251");

     
  • Christian Mayer

    Christian Mayer - 2013-12-25

    Encoding issues should be fixed in 2.2.4. Can you confirm that ?

     

Log in to post a comment.