Git Product home page Git Product logo

baan-utf-t-decoder's Introduction

baan-UTF-T-decoder

Decoding UTF-T texts in PostgreSQL

This small extension program permits to decode the text tables of Infor baan IV or ERP LN. Those texts are encoded in UTF-T, so they need to be converted into UTF-8 for being used in a database.

While PostgreSQL is not currently supported by ERP LN, we connect it to baan or LN database using foreign data wrapper. This way we may develop applications on PostgreSQL.

INSTALL

In order to compile this extension, verify that you have pg_config in your path (it should be part of the postgresql development tools). Download pgutft.c file Then, execute:

sudo docker cp pgutft.c mycontainer:/usr/include/postgresql/pgutft.c
sudo docker exec -it mycontainer /bin/bash
cp -a /usr/include/postgresql/12/server/. /usr/include/postgresql/
cd $(pg_config --includedir)
gcc -I$(pg_config --includedir) -fPIC -MMD -MP -MF pgutft.o.d -o pgutft.o pgutft.c -c
gcc -o libpgUTF-T.so pgutft.o -shared
cp libpgUTF-T.so $(pg_config --pkglibdir)
cp pgutft.o $(pg_config --pkglibdir)

once the library is installed in the postgresql extension directory, connect to your database as super user and execute

CREATE FUNCTION utft_to_utf8(bytea) RETURNS text
      AS 'libpgUTF-T.so', 'utft_to_utf8'
      LANGUAGE C STRICT;

If you want to let other users uses it, grant them the access to the function this way: GRANT ALL ON FUNCTION utft_to_utf8(bytea) TO username;

USAGE

if your text has many lines, join them as bitea, then pass it to utft_to_utf8() function:

select utft_to_utf8(text_from_baan_table);

baan-utf-t-decoder's People

Contributors

nicofeliceeurotech avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.