Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-04 Thread Alexander Huemer
On Tue, Dec 03, 2013 at 12:56:08PM +0100, patrick295767 patrick295767 wrote:
> If you are developing C/C++ programs in a terminal environment, you
> may know the problem of the codepages. Sometimes in Putty, SSH,... you
> may have some problems with characters.
> 
> What about this "Portability" of your terminal applications? - Not
> great, isn't it?
> 
> If you would like to have your code portable and also looking the same
> on each operating system, it will not be so easy.
> 
> For instance, Latin,... codes are necessary depending on the country.
> One which is cool is the CP437. I like the CP437 on Linux for xterm
> for nice terminal images, but the problem is that users have not
> necessarily all installed. CP437 remains also portable with windows
> PDcurses dll (I mean the pdc34dll.zip one, without 'w').
> http://dmr.ath.cx/misc/cp437/
> 
> 
> 
> Would you know a technique to have a way that your application looks
> the same on whatever system (Linux, Mac, OS/2, Windows,..)?

Somehow related, and quite new:
http://mortoray.com/2013/11/27/the-string-type-is-broken/

Kind regards,
-Alex



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread Thorsten Glaser
Carlos Torres dixit:

>here we go again...

Sure… googlemail user ;)

>should they ban people that use fortune in their signatures too?

You’d be amazed to hear that I have a collection of individual
sig files and select one manually when I don’t want to use the
default one, which I rotate occasionally manually.

^Kr in jupp.

bye,
//mirabilos
-- 
 Ich gebs zu, jupp ist cool



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread Carlos Torres
Hello Thorsten,

On 12/3/13, Thorsten Glaser  wrote:
>
> I did suggest banning them, didn’t I? ☺
>

here we go again...

>
> bye,
> //mirabilos
> --
> „Also irgendwie hast du IMMER recht. Hier zuckelte gerade ein Triebwagen
> mit
> der Aufschrift "Ostdeutsche Eisenbahn" durch Wuppertal. Ich glaubs machmal
> nicht…“   -- Natureshadow, per SMS
> „Hilf mir mal grad beim Denken“   -- Natureshadow, IRL, 2x
>
>

should they ban people that use fortune in their signatures too?

--Carlos



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread Thorsten Glaser
patrick295767 patrick295767 dixit:

>I think about various possible POSIX and non-POSIX platforms, which
>allow compiling with gcc or g++:

You missed MirBSD, which incidentally is UTF-8 only (with the known
issue that you need to run “script -lns” or GNU screen on the text
console, but for Unicode you want xterm anyway).


Troels Henriksen dixit:

>patrick295767 patrick295767  writes:

>> Let's take a well-known program: vim compiled for Windows. If you use
>> gvim.exe in Windows, you have a perfect result. No simple problem with
>> characters.
>> However, if you take vim.exe (from the same directory as gvim.exe) and
>> use it in the windows console (execute: cmd then type vim), you end up

>That's because the standard Windows terminal is terrible.  I would
>advise never using it.  Pretty much every other terminal in works
>properly, because they don't try to simulate some ancient DOS
>abomination.

You’re right on the suggestion of not using it. (I read about PuTTY
being suggested as replacement – does it allow a “local” shell? If
so, it could even be used on Win32s which allowed 32-bit programs
to run on Win3.1 but not console programs… hm…)

But there are two ways to fix this for vim.exe:

• chcp 65001 (switch the “codepage” to UTF-8, works horrible).

• Change vim.exe to use the “wide” console instead of the ANSI/OEM
  console functions, which use proper UCS-2 (later UTF-16) characters
  for terminal I/O (works like a charm and even in NT 3.x).


Christoph Lohmann dixit:

>On Tue, 03 Dec 2013 18:53:04 +0100 Noah Birnel  wrote:
 ^
>> On Tue, Dec 03, 2013 at 04:00:14PM +0100, Christoph Lohmann wrote:
>> > Windows has to
>> > adapt to Open Source and not the other way around.

Right. Actually, they kinda did and are no longer among the biggest
three offenders against OSS.

>> Hahahahaha.

>Please read up on software history. But maybe your poor Windows adminis‐
>trator life took away your sanity and sense for what’s possible.  Please

Or his Googlemail administrator. Or both…

>leave suckless as fast as you can.

I did suggest banning them, didn’t I? ☺


bye,
//mirabilos
-- 
„Also irgendwie hast du IMMER recht. Hier zuckelte gerade ein Triebwagen mit
der Aufschrift "Ostdeutsche Eisenbahn" durch Wuppertal. Ich glaubs machmal
nicht…“ -- Natureshadow, per SMS
„Hilf mir mal grad beim Denken“ -- Natureshadow, IRL, 2x



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread Dmitrij D. Czarkoff
Troels Henriksen said:
> You really shouldn't write terminal programs that require precise
> colours.

FWIW as a rule you really shouldn't write terminal programs that use
colours.

-- 
Dmitrij D. Czarkoff



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread Troels Henriksen
patrick295767 patrick295767  writes:

> You are completely right. Windows is important.
>
>
> Another point... what about colors?  You never know what the user
> using your program will get.
> Linux terminal, Windows Terminal, xterm,...
>
> e.g:
> http://invisible-island.net/xterm/images/contrast.jpg

You really shouldn't write terminal programs that require precise
colours.

-- 
\  Troels
/\ Henriksen



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread patrick295767 patrick295767
You are completely right. Windows is important.


Another point... what about colors?  You never know what the user
using your program will get.
Linux terminal, Windows Terminal, xterm,...

e.g:
http://invisible-island.net/xterm/images/contrast.jpg

2013/12/3 Noah Birnel :
> On Tue, Dec 03, 2013 at 04:00:14PM +0100, Christoph Lohmann wrote:
>> Windows has to
>> adapt to Open Source and not the other way around.
>
> Hahahahaha.
>
> You live in a wonderful world.
>
> Cheers,
>
> Noah
>



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread Christoph Lohmann
Greetings.

On Tue, 03 Dec 2013 18:53:04 +0100 Noah Birnel  wrote:
> On Tue, Dec 03, 2013 at 04:00:14PM +0100, Christoph Lohmann wrote:
> > Windows has to
> > adapt to Open Source and not the other way around.
> 
> Hahahahaha.
> 
> You live in a wonderful world.

Please read up on software history. But maybe your poor Windows adminis‐
trator life took away your sanity and sense for what’s possible.  Please
leave suckless as fast as you can.


Sincerely,

Christoph Lohmann




Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread Noah Birnel
On Tue, Dec 03, 2013 at 04:00:14PM +0100, Christoph Lohmann wrote:
> Windows has to
> adapt to Open Source and not the other way around.

Hahahahaha.

You live in a wonderful world.

Cheers,

Noah



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread Troels Henriksen
patrick295767 patrick295767  writes:

> Let's take an example:
>
> Let's take a well-known program: vim compiled for Windows. If you use
> gvim.exe in Windows, you have a perfect result. No simple problem with
> characters.
> However, if you take vim.exe (from the same directory as gvim.exe) and
> use it in the windows console (execute: cmd then type vim), you end up
> with strange chars if you are using special accents, and so on.
> (with a well configured terminal).
>
> I just would like to point that problems, even on well known programs,
> may still today be present (and quite annoying for some users).
> Vim has more than 20 years existence, but still, some problems may
> still exist with characters, although Unicode/utf-8,.. are there to
> make it easier.
> (It is a bug).

That's because the standard Windows terminal is terrible.  I would
advise never using it.  Pretty much every other terminal in works
properly, because they don't try to simulate some ancient DOS
abomination.

-- 
\  Troels
/\ Henriksen



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread Christoph Lohmann
Greetings.

On Tue, 03 Dec 2013 16:00:14 +0100 patrick295767 patrick295767 
 wrote:
> Hello,
> 
> If you are developing C/C++ programs in a terminal environment, you
> may know the problem of the codepages. Sometimes in Putty, SSH,... you
> may have some problems with characters.

I  had  that  problem 15 years ago. Then I forced everyone to use UTF‐8.
Now I am living in a world without that problem of the past.

> What about this "Portability" of your terminal applications? - Not
> great, isn't it?

You are coming from 15 years ago?

> If you would like to have your code portable and also looking the same
> on each operating system, it will not be so easy.

Of course it is in 2013: Use UTF‐8.

> For instance, Latin,... codes are necessary depending on the country.
> One which is cool is the CP437. I like the CP437 on Linux for xterm
> for nice terminal images, but the problem is that users have not
> necessarily all installed. CP437 remains also portable with windows
> PDcurses dll (I mean the pdc34dll.zip one, without 'w').
> http://dmr.ath.cx/misc/cp437/

People  still using Windows in 2013 deserve their misery. Windows has to
adapt to Open Source and not the other way around. So  stop  using  Win‐
dows.

> Would you know a technique to have a way that your application looks
> the same on whatever system (Linux, Mac, OS/2, Windows,..)?

For  Linux  use st and UTF‐8 and for Windows Putty and UTF‐8. On Android
you have a Terminal too.

Applications do not need to look all the same. That’s a farce. They have
to be usable everywhere.


Sincerely,

Christoph Lohmann




Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread patrick295767 patrick295767
Let's take an example:

Let's take a well-known program: vim compiled for Windows. If you use
gvim.exe in Windows, you have a perfect result. No simple problem with
characters.
However, if you take vim.exe (from the same directory as gvim.exe) and
use it in the windows console (execute: cmd then type vim), you end up
with strange chars if you are using special accents, and so on.
(with a well configured terminal).

I just would like to point that problems, even on well known programs,
may still today be present (and quite annoying for some users).
Vim has more than 20 years existence, but still, some problems may
still exist with characters, although Unicode/utf-8,.. are there to
make it easier.
(It is a bug).


2013/12/3 Troels Henriksen :
> patrick295767 patrick295767  writes:
>
>> I am not so sure if you can get all the unicode well displayed on most
>> terminals.
>>
>> If you make a nice art / ascii graphic, you are never sure whether it
>> will end well displayed depending on the system/terminal, that the
>> user uses.
>
> No, but it's more likely than any other encoding (apart from plain
> ASCII), and it will only improve, given that almost every platform has
> adopted at least Unicode (and often UTF-8 specifically) as the preferred
> way to deal with text.
>
> I'm not saying UTF-8 is perfect, just that it's the best choice.  But
> yeah, stay away from the weirdest characters.  For example, '💩', which I
> often find useful when discussing software, is missing in many fonts.
>
> --
> \  Troels
> /\ Henriksen
>



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread Troels Henriksen
patrick295767 patrick295767  writes:

> I am not so sure if you can get all the unicode well displayed on most
> terminals.
>
> If you make a nice art / ascii graphic, you are never sure whether it
> will end well displayed depending on the system/terminal, that the
> user uses.

No, but it's more likely than any other encoding (apart from plain
ASCII), and it will only improve, given that almost every platform has
adopted at least Unicode (and often UTF-8 specifically) as the preferred
way to deal with text.

I'm not saying UTF-8 is perfect, just that it's the best choice.  But
yeah, stay away from the weirdest characters.  For example, '💩', which I
often find useful when discussing software, is missing in many fonts.

-- 
\  Troels
/\ Henriksen



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread patrick295767 patrick295767
I am not so sure if you can get all the unicode well displayed on most
terminals.

If you make a nice art / ascii graphic, you are never sure whether it
will end well displayed depending on the system/terminal, that the
user uses.

example of various chars:
http://www.unicode.org/charts/PDF/U2500.pdf

I think about various possible POSIX and non-POSIX platforms, which
allow compiling with gcc or g++:

  BSD variants:
  FreeBSD 9.0, 8.2, 7.0, 6.4, 4.9
  OpenBSD 4.9
  NetBSD 5.1
  GNU/Linux
  Slackware 13.x
  Debian 6.0, 5.0, 3.1
  Fedora 13-16, CentOS 4-6
  Mandrake 2010
  SuSE 11, 12

  AIX 5.3, 5.1 (cc, gcc)
  BeOS R5
  Cygwin
  HPUX 11.23, 11.11, 11.00, 10.20
  IRIX64
  Mac OS X 10.7
  OS/2 EMX 0.9d (gcc 2.7.2)
  QNX 6.1
  SCO OpenServer 5.0.5e (cc/CC, gcc 2.7.2.3)
  Solaris 10, 9, 8, 7, 6, 2.51
  Tru64 (aka OSF1 and Digital Unix) 4.0d, 5.1 (cc)
  Windows 7, using MinGW

2013/12/3 patrick295767 patrick295767 :
> The UTF-8 is sure the one to adopt. Luckily it exists ;)
>
> "Unicode also has all the weird line-drawing characters you could ever
> want, if you find them important."
> Indeed. You have a good compatibility, however a limited number of
> "weid" characters.
>
> However, if you would like to show nice effects, you may use extended
> one: CP437, for instance, and the windows one is a "standard".
> This is likely not installed or you may have some "porting" problems.
>
>
> 2013/12/3 Ismael Luceno :
>> On Tue, 03 Dec 2013 12:59:59 +0100
>> Troels Henriksen  wrote:
>>> patrick295767 patrick295767  writes:
>>>
>>> > Would you know a technique to have a way that your application looks
>>> > the same on whatever system (Linux, Mac, OS/2, Windows,..)?
>>>
>>> Use UTF-8.  Seriously, different character sets are such an incredibly
>>> sucky thing that nobody should consider re-introducing them, unless
>>> necessary to interact with legacy systems.  (Of course, one should
>>> consider Windows to be legacy...)  Unicode also has all the weird
>>> line-drawing characters you could ever want, if you find them
>>> important.
>>>
>>> On which systems are the Latin-set of code pages still necessary?
>>>
>>
>> Have you heard of UTF-8? Try using luit for legacy applications.
>>



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread patrick295767 patrick295767
The UTF-8 is sure the one to adopt. Luckily it exists ;)

"Unicode also has all the weird line-drawing characters you could ever
want, if you find them important."
Indeed. You have a good compatibility, however a limited number of
"weid" characters.

However, if you would like to show nice effects, you may use extended
one: CP437, for instance, and the windows one is a "standard".
This is likely not installed or you may have some "porting" problems.


2013/12/3 Ismael Luceno :
> On Tue, 03 Dec 2013 12:59:59 +0100
> Troels Henriksen  wrote:
>> patrick295767 patrick295767  writes:
>>
>> > Would you know a technique to have a way that your application looks
>> > the same on whatever system (Linux, Mac, OS/2, Windows,..)?
>>
>> Use UTF-8.  Seriously, different character sets are such an incredibly
>> sucky thing that nobody should consider re-introducing them, unless
>> necessary to interact with legacy systems.  (Of course, one should
>> consider Windows to be legacy...)  Unicode also has all the weird
>> line-drawing characters you could ever want, if you find them
>> important.
>>
>> On which systems are the Latin-set of code pages still necessary?
>>
>
> Have you heard of UTF-8? Try using luit for legacy applications.
>



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread Ismael Luceno
On Tue, 03 Dec 2013 12:59:59 +0100
Troels Henriksen  wrote:
> patrick295767 patrick295767  writes:
> 
> > Would you know a technique to have a way that your application looks
> > the same on whatever system (Linux, Mac, OS/2, Windows,..)?
> 
> Use UTF-8.  Seriously, different character sets are such an incredibly
> sucky thing that nobody should consider re-introducing them, unless
> necessary to interact with legacy systems.  (Of course, one should
> consider Windows to be legacy...)  Unicode also has all the weird
> line-drawing characters you could ever want, if you find them
> important.
> 
> On which systems are the Latin-set of code pages still necessary?
> 

Have you heard of UTF-8? Try using luit for legacy applications.



Re: [dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread Troels Henriksen
patrick295767 patrick295767  writes:

> Would you know a technique to have a way that your application looks
> the same on whatever system (Linux, Mac, OS/2, Windows,..)?

Use UTF-8.  Seriously, different character sets are such an incredibly
sucky thing that nobody should consider re-introducing them, unless
necessary to interact with legacy systems.  (Of course, one should
consider Windows to be legacy...)  Unicode also has all the weird
line-drawing characters you could ever want, if you find them important.

On which systems are the Latin-set of code pages still necessary?

-- 
\  Troels
/\ Henriksen



[dev] Bringing together OS'es terminals and their codepages

2013-12-03 Thread patrick295767 patrick295767
Hello,

If you are developing C/C++ programs in a terminal environment, you
may know the problem of the codepages. Sometimes in Putty, SSH,... you
may have some problems with characters.

What about this "Portability" of your terminal applications? - Not
great, isn't it?

If you would like to have your code portable and also looking the same
on each operating system, it will not be so easy.

For instance, Latin,... codes are necessary depending on the country.
One which is cool is the CP437. I like the CP437 on Linux for xterm
for nice terminal images, but the problem is that users have not
necessarily all installed. CP437 remains also portable with windows
PDcurses dll (I mean the pdc34dll.zip one, without 'w').
http://dmr.ath.cx/misc/cp437/



Would you know a technique to have a way that your application looks
the same on whatever system (Linux, Mac, OS/2, Windows,..)?


Best wishes & Regards,
Pat