Change installation to UNICODE

Started by Dani@M3T, January 08, 2014, 07:09:24 PM

Previous topic - Next topic

Dani@M3T

We just installed netxms (compiled from sources) on OpenSUSE13.1 (virtualized on Hyper-V 2012 R2). Database is PostgreSQL. Now after some configuration, we can't use any german umlauts (äöü) in netxms. I saw now a configure option '--enable-unicode'. Is it possible to recompile with this option and reuse the same database (on PostgreSQL). What should we consider? Thanks!

Victor Kirhenshtein

Hi!

You can just recompile server with UNICODE support and connect to same database. It should work just fine.

Best regards,
Victor

Dani@M3T

Hi Victor

Thanks. I just made a snapshot of the NetXMS-server, stopped the server and the agent and recompiled with UNICODE-support:
./configure --with-server --with-agent --with-pgsql --enable-unicode --prefix=/opt/netxms

But no luck. I made a few Tests (from Java Management Console on Win7-64bit, Version 1.2.10 like the server):
- set äöü in the message text of a Mail-Action, after 'OK' there was only a special charakter '' in the field (in the recieved mail too)
- in a custom map, I created a group box with the name 'Aäöü', only 'A' is shown in the map afterwards
- add a custom attribute to an existing node, Name='Test', Value='äöü' -> the value shows 'äöü' -> here it's ok

the result is inconsistent, some is ok, some not

Dani

Victor Kirhenshtein

Hi!

What is your database settings? It is recommended to use UTF-8 encoding in PostgreSQL.

Best regards,
Victor

Dani@M3T

Hi Victor

The database is UTF-8:

netxms_db=# \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
netxms_db | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres         +

hmmm...

Victor Kirhenshtein

I just build new test server with fresh PostgreSQL database, and everything seems to work. My DB settings are like yours:

root@debian7-x64:~/netxms# psql -h 127.0.0.1 -U netxms
Password for user netxms:
psql (9.1.11)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.

netxms=> \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-----------+----------+----------+-------------+-------------+-----------------------
netxms    | netxms   | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
(4 rows)

netxms=>

I enter characters with umlauts in few different places (see screenshot).

Are you sure you didn't make any mistake when installing unicode version? Also, can you check how these texts really stored in database (for example, in actions table)?

Best regards,
Victor

Dani@M3T

Hi Victor

Thanks for your tests. Now I have redone the recompile. I deleted the /opt/netxms completely and recompiled with:
configure --enable-unicode --with-server --with-agent --with-pgsql --prefix=/opt/netxms
than I created an action 'Testaäoöuü' (without quotes of course). In the java console I only saw 'Testa'. Than I added 'aäoöuü' to an existing string of another action, there I couldn't see anything behind 'a'. Than I opened the database in pgAdmin and saw in the table 'actions' absolutely the same text as in the console. See attached printscrenn. Very strange.
I can send you the outputs of configure, make and make install if that could help (per mail?)
Another test was the following:
In the not with unicode option compiled version of netxms: I can enter umlauts in node custom fields (and they are stored accurate) but not in actions or maps for example.


Victor Kirhenshtein

Hi!

config.log may help. You can send it to [email protected]. Now I suspect problems with iconv on your server. Java console and our network communication protocol uses UCS-2, but native wide characters for Linux is UCS-4, so we use iconv for UCS-2/UCS-4 conversion.

Best regards,
Victor

Dani@M3T


Dani@M3T

Update to Version 1.2.11 fixed the problem for me.

thanks Victor