--Sig_/5vOzmY=pd=LSdNAZ9_NQWu9
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi there,

I=E2=80=99m just trying to get started with the curses library in Ruby=E2=
=80=99s
standard library. I wanted to draw a window using the =E2=80=9Creal=E2=80=
=9D unicode
characters for this, i.e. =E2=94=80 for horizontal and =E2=94=82 for vertic=
al lines
(UTF-8 being pretty standard now, using - and | is not an option). So I
tried the obvious (the following is a self-contained example):

=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
# -*- coding: utf-8 -*-
require "curses"

include Curses

begin
  crmode

  str =3D "Hello world =E2=98=BA"

  win =3D Window.new(lines, cols, 0, 0)
  win.box("=E2=94=80", "=E2=94=82")
  #win.box("-", "|")
  win.setpos( lines / 2, (cols / 2) - (str.chars.count / 2) )
  win.addstr str

  win.refresh
  win.getch
ensure
  close_screen
end
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80

This presents me a window with a border of blinking reverse-video =E2=80=9C=
=C3=A2=E2=80=9D
characters instead of the expected continuous lines. Interestingly, the
unicode smiley (=E2=98=BA) in #addstr is displayed correctly, so I doubt it=
=E2=80=99s a
problem with curses itself.

So: How do I get continuous lines for window borders with curses?

Valete,
Marvin

--Sig_/5vOzmY=pd=LSdNAZ9_NQWu9
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (GNU/Linux)

iQEcBAEBAgAGBQJSKIsSAAoJELh1XLHFkqhaji8H/jvdFA9r2O4AEuTY7g7S0f4t
2ZAo1vyXbTFEz88VfRknaATnCURIPiEvGprCEYfpBhyEp2oZxBwRuQoPk2n6/yH2
kscqwrqbWLnC5GkxW8+G741KTXF2OGFwDqrMMaq7ZTpr3ws4vxUPD9O1kQUW8v7R
iPvJ/q82fkDjURdQw4BKFMsKMig+7875Qrdsyq/tw5DVQdISQAP9fAF3LHYnilDK
IWxUhyx33h/tzovphKX9NT4UidW/LQFnYSm4O5gT/Bu9syyxsVCEViOoaYRnt8TH
ZEoCQpejxWsYaYD4YpHFlgtgJ5HBj1s8p1giyt4ELuDEFEtx47GQA2BHhCKgq0c=
=CGwr
-----END PGP SIGNATURE-----

--Sig_/5vOzmY=pd=LSdNAZ9_NQWu9--
Hi there,

I’m just trying to get started with the curses library in Ruby’s
standard library. I wanted to draw a window using the “real” unicode
characters for this, i.e. ─ for horizontal and │ for vertical lines
(UTF-8 being pretty standard now, using - and | is not an option). So I
tried the obvious (the following is a self-contained example):

──────────────────────────────────────
# -*- coding: utf-8 -*-
require "curses"

include Curses

begin
  crmode

  str = "Hello world "

  win = Window.new(lines, cols, 0, 0)
  win.box("─", "│")
  #win.box("-", "|")
  win.setpos( lines / 2, (cols / 2) - (str.chars.count / 2) )
  win.addstr str

  win.refresh
  win.getch
ensure
  close_screen
end
──────────────────────────────────────

This presents me a window with a border of blinking reverse-video “”
characters instead of the expected continuous lines. Interestingly, the
unicode smiley () in #addstr is displayed correctly, so I doubt it’s a
problem with curses itself.

So: How do I get continuous lines for window borders with curses?

Valete,
Marvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (GNU/Linux)

iQEcBAEBAgAGBQJSKIsSAAoJELh1XLHFkqhaji8H/jvdFA9r2O4AEuTY7g7S0f4t
2ZAo1vyXbTFEz88VfRknaATnCURIPiEvGprCEYfpBhyEp2oZxBwRuQoPk2n6/yH2
kscqwrqbWLnC5GkxW8+G741KTXF2OGFwDqrMMaq7ZTpr3ws4vxUPD9O1kQUW8v7R
iPvJ/q82fkDjURdQw4BKFMsKMig+7875Qrdsyq/tw5DVQdISQAP9fAF3LHYnilDK
IWxUhyx33h/tzovphKX9NT4UidW/LQFnYSm4O5gT/Bu9syyxsVCEViOoaYRnt8TH
ZEoCQpejxWsYaYD4YpHFlgtgJ5HBj1s8p1giyt4ELuDEFEtx47GQA2BHhCKgq0c=
=CGwr
-----END PGP SIGNATURE-----