Giter Site home page Giter Site logo

Problems using UTF8 encoding about pspg HOT 11 CLOSED

okbob avatar okbob commented on July 17, 2024
Problems using UTF8 encoding

from pspg.

Comments (11)

okbob avatar okbob commented on July 17, 2024

from pspg.

albertca avatar albertca commented on July 17, 2024

Test case output:

x.txt

and dump:

dump.txt

from pspg.

okbob avatar okbob commented on July 17, 2024

I don't see any issue on these data in my Gnome Terminal - can me send a screenshot? less doesn't use ncurses, so lot of things can be different.

from pspg.

ajouanjean avatar ajouanjean commented on July 17, 2024

Same problem here

❯ echo $LANG                                                                                                                                                
fr_FR.UTF-8

❯ echo $LC_CTYPE                                                                                                                                            fr_FR.UTF-8

❯ cat .psqlrc #pager is pspg 
[...]
\setenv PAGER 'pspg -s 0'
\set border 2
[...]


❯ psql -d postgres                                                                                                                                          
[local] dtm@postgres=#
[local] dtm@postgres=# SELECT 'un bel été' from generate_series(1, 100);

The output gives this:

kitty_portable_2017-09-18_16-15-21

And if I try with less as the pager:

[local] dtm@postgres=# \setenv PAGER 'less'
[local] dtm@postgres=# SELECT 'un bel été' from generate_series(1, 100);

I have this:
kitty_portable_2017-09-18_16-17-10

First I thought it was because I used PuttY (Kitty here) on windows, but same apply to a terminal window in Ubuntu 16.04 (although it is within a VirtualBox machine).

Hope this clarifies.

from pspg.

okbob avatar okbob commented on July 17, 2024

It is work on my Linux - Fedora 25. Please, can you show log of compilation. Maybe there are some issue with ncurses. "less" doesn't use ncurses, so there should not be this problem.

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

ajouanjean avatar ajouanjean commented on July 17, 2024

Maybe it is a ncurses vs. ncursesw issue:

Sorry, I am no expert at all at C programming (nor at SQL actually), so it might not be a good lead... just some googling around.

Anyway hope this helps!

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

ajouanjean avatar ajouanjean commented on July 17, 2024

Ok it is working now.

What I did:

  • Install latest dev lib of ncursesw: sudo apt-get install libncursesw5-dev
  • Update the repo git pull
  • Configure
❯ ./configure                                                                                                                                               datamart@occitane-datamart-pink
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ncursesw via pkg-config... yes
checking for working ncursesw/curses.h... yes
checking for working ncursesw.h... no
checking for working ncurses.h... yes
configure: creating ./config.status
config.status: creating config.make
  • Make
❯ make                                                                                                                                                      datamart@occitane-datamart-pink
gcc src/pspg.c -o pspg -g -O2    -lncursesw -ltinfo
  • Make install
❯ _ make install                                                                                                                                            datamart@occitane-datamart-pink
tools/install.sh bin pspg "/usr/local/bin"

And now it is OK.
@albertca may be that could help you too.

from pspg.

albertca avatar albertca commented on July 17, 2024

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

Related Issues (20)

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.