Fwd: Changing the terminal character set
-- Forwarded message -- From: Frederic Marchal Date: 18 July 2015 at 12:41 Subject: Re: Changing the terminal character set To: debian-user@lists.debian.org On Saturday 18 July 2015 10:52:33 Alex Naysmith wrote: > I'm writing python scripts with the curses GUI and I need the CP437 > character set. > > How can I change the character encoding in the XFCE terminal [v0.4.8] from > UTF-8 to CP437 or IBM437? > > Alternatively, I did attempt to change the system locale from en_GB.UTF-8 > to one that contained CP437/IBM437. However, no CP437 character sets > appeared as an option in 'dpkg-configure locales' command [although 'IBM437 > does appear as an available character set in 'locales -m'.] > > Changing the system locale from UTF-8 probably isn't a good idea anyway, so > it would be ideal if the character set changed was confined to the XFCE > terminal for the purposes of the curses python script. I don't expect it to be easy to change the terminal encoding. There is really no reason to do it. UTF-8 is so ubiquitous… The best solution to your problem depends on why you need to change the character encoding of the terminal. I expect both the python engine and the curse library to read UTF-8 files just fine and do it even better than CP437 if UTF-8 is the system encoding. If they don't, they are probably not correctly configured or compiled. You should be able to write and test your script using UTF-8. If you really need to write your script using CP437, there are a number of text editors that can read and write files using whatever encoding you want. Vim and kwrite can both do it. There is no need to change the terminal encoding just to write a script with CP437. If you need to send the script to someone that specifically requested CP437 encoded files, you should write and test the script using UTF-8 (taking care of only using characters available in CP437) and then, when you are ready to give it away, convert it using iconv: iconv -f utf8 -t cp437 source -o source_in_cp437 Note that there are a number of text editors on Windows that can read UTF-8 files if that's your concern. Similarly, if your python script must produce CP437 output, you can convert the output on the fly using iconv python script | iconv -f utf8 -t cp437 | other_command That's admittedly not very convenient. So, does the python "encode" command (http://www.tutorialspoint.com/python/string_encode.htm) help you? Frederic Problem solved. The following lines of code are required for Python 2.7 without the need to change any terminal locale settings: import locale locale.setlocale(locale.LC_ALL, '') smiley_icon=u'\u263A'.encode('utf-8') Curses can then output with the addstr() call. Regards Alex
Changing the terminal character set
I'm writing python scripts with the curses GUI and I need the CP437 character set. How can I change the character encoding in the XFCE terminal [v0.4.8] from UTF-8 to CP437 or IBM437? Alternatively, I did attempt to change the system locale from en_GB.UTF-8 to one that contained CP437/IBM437. However, no CP437 character sets appeared as an option in 'dpkg-configure locales' command [although 'IBM437 does appear as an available character set in 'locales -m'.] Changing the system locale from UTF-8 probably isn't a good idea anyway, so it would be ideal if the character set changed was confined to the XFCE terminal for the purposes of the curses python script. Regards Alex
[SOLVED] Re: Missing resolutions, xrandr and nvidia
On 9 February 2014 23:16, Alex Naysmith wrote: > With Debian Wheezy installed, I have the Geforce 6800 GT graphics card. > The screen flickers every few seconds with the default nouveau drivers. I > therefore installed the version 304.88 nvidia drivers [1]. > > These drivers enable 3D acceleration as well as eliminate the screen > flickering. However, I have a limited range of screen resolutions available. > > I know 1680x1050 60Hz is available on my HDTV. When I try to use xrandr to > add a new mode with the following commands.. > > xrandr --newmode "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 > 1059 1089 -hsync +vsync > > xrandr --addmode VGA-0 1680x1050_60.00 > > I get this error message: > X Error of failed request: BadMatch (invalid parameter attributes) > Major opcode of failed request: 154 (RANDR) > Minor opcode of failed request: 18 (RRAddOutputMode) > Serial number of failed request: 29 > Current serial number in output stream: 30 > > This is apparently due to the incompatibilities between xrandr and the > nvidia compiled driver. Is anyone aware of a version of nvidia driver that > does work with the Geforce 6800 GT? > > [1]: https://wiki.debian.org/NvidiaGraphicsDrivers#Version_304.88 > I've found a solution!. The problem is that the HDTV [Toshiba 32BL702B] does not send any EDID information through the VGA socket. No EDID bytes were posted on the /var/log/xorg.0.log. Without the EDID data, the nvidia driver will not recognise the available resolutions and default to 640x480 or something similar. Instead of using the VGA input on the HDTV, I connected to one of the HDMI inputs using a DVI-D to HDMI cable. The computer then received the EDID data and recognised all the available resolutions.
Missing resolutions, xrandr and nvidia
With Debian Wheezy installed, I have the Geforce 6800 GT graphics card. The screen flickers every few seconds with the default nouveau drivers. I therefore installed the version 304.88 nvidia drivers [1]. These drivers enable 3D acceleration as well as eliminate the screen flickering. However, I have a limited range of screen resolutions available. I know 1680x1050 60Hz is available on my HDTV. When I try to use xrandr to add a new mode with the following commands.. xrandr --newmode "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync xrandr --addmode VGA-0 1680x1050_60.00 I get this error message: X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 154 (RANDR) Minor opcode of failed request: 18 (RRAddOutputMode) Serial number of failed request: 29 Current serial number in output stream: 30 This is apparently due to the incompatibilities between xrandr and the nvidia compiled driver. Is anyone aware of a version of nvidia driver that does work with the Geforce 6800 GT? [1]: https://wiki.debian.org/NvidiaGraphicsDrivers#Version_304.88
Re: Why Debian
I previously used Xubuntu and was very happy with it until Software Centre superseded Synaptic as the default graphical package manager. Software Centre is just horrible and slow and no good for old computers. Arch takes too long to set up and can cause head-aches when Pacman -Syu makes significant changes (such as the change from HAL to udev). I've not tried OpenSuse, but it does look interesting. I'm pleasantly surprised with just how similar Debian XFCE and Xubuntu are, which makes me wonder if there are any major differences at all. On 19 November 2013 20:13, Alois Mahdal wrote: > On Tue, 19 Nov 2013 14:40:57 +0100 > berenger.mo...@neutralite.org wrote: > > > > So, I think that the problems you had with untrusted packages > > can be: > > 1) your fault: did you install the key? > > 2) mate developer's fault, if they did not provided one. > > 3) your package management software's fault. > > 4) there is an actual ongoing MITM attack. > > Isn't it ironic, how we people tend to forget about real > meaning of own alarms? *Especially* those of us who > really understand them? > > > aL. > -- > Alois Mahdal > > > -- > To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org > with a subject of "unsubscribe". Trouble? Contact > listmas...@lists.debian.org > Archive: http://lists.debian.org/20131119211321.2210e...@hugo.daonet.home > >
Re: Procedure to uninstall nvidia drivers and restore nouveau
After purging the nvidia drivers with the following command: #aptitude purge nvidia-kernel-dkms nvidia-glx The nvidia driver is still present and functioning. During the [failed] purge, I received the message 'No packages will be installed, upgraded, or removed'. On 10 November 2013 21:44, Alex Naysmith wrote: > After following the procedure at > https://wiki.debian.org/NvidiaGraphicsDrivers to install the > nvidia-glx-legacy-173xx package for my GeForce FX5550 card [Debian 7 > "Wheezy"], I would like to know the best method to return to the nouveau > driver with the files from the glx-legacy-1733 package removed including > the /etc/X11/xorg.d directory. I think users would benefit from an > 'uninstall nvidia driver' wiki page. > > Regards >
Re: Procedure to uninstall nvidia drivers and restore nouveau
Thank you all for the sed regex explanation. What possible kernel variations other than 'generic' are possible to require the sed substitution? After some googling, I've discovered that I'm actually compiling the nvidia driver and hence the business with the Linux header. On 12 November 2013 07:56, Alex Naysmith wrote: > From the nvidia install procedure is the following command: > > # aptitude -r install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') > nvidia-kernel-legacy-173xx-dkms > > I can see the pipe | symbol and the regular expressions but I don't really > understand what this command is doing. > > > Alex > > > On 10 November 2013 21:44, Alex Naysmith wrote: > >> After following the procedure at >> https://wiki.debian.org/NvidiaGraphicsDrivers to install the >> nvidia-glx-legacy-173xx package for my GeForce FX5550 card [Debian 7 >> "Wheezy"], I would like to know the best method to return to the nouveau >> driver with the files from the glx-legacy-1733 package removed including >> the /etc/X11/xorg.d directory. I think users would benefit from an >> 'uninstall nvidia driver' wiki page. >> >> Regards >> > >
Re: Procedure to uninstall nvidia drivers and restore nouveau
>From the nvidia install procedure is the following command: # aptitude -r install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-legacy-173xx-dkms I can see the pipe | symbol and the regular expressions but I don't really understand what this command is doing. Alex On 10 November 2013 21:44, Alex Naysmith wrote: > After following the procedure at > https://wiki.debian.org/NvidiaGraphicsDrivers to install the > nvidia-glx-legacy-173xx package for my GeForce FX5550 card [Debian 7 > "Wheezy"], I would like to know the best method to return to the nouveau > driver with the files from the glx-legacy-1733 package removed including > the /etc/X11/xorg.d directory. I think users would benefit from an > 'uninstall nvidia driver' wiki page. > > Regards >
Procedure to uninstall nvidia drivers and restore nouveau
After following the procedure at https://wiki.debian.org/NvidiaGraphicsDrivers to install the nvidia-glx-legacy-173xx package for my GeForce FX5550 card [Debian 7 "Wheezy"], I would like to know the best method to return to the nouveau driver with the files from the glx-legacy-1733 package removed including the /etc/X11/xorg.d directory. I think users would benefit from an 'uninstall nvidia driver' wiki page. Regards