Re: UTF-8 / cp-1252 curiousness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew Mason wrote:

> 1) can i get konsole to set the session encoding to be that of the
> server/machine that i am connecting to ?

Do you use ssh? If you know for which machines you need to use the other
encoding, you could do something like this:

alias console_utf8='printf "\\033%%G"'
alias console_8bit='printf "\\033%%@"'
# see "man console_codes" (works also in the KDE konsole)

# for some hosts, switch to 8 bit console
ssh ()
{
  case $1 in
    *hostname|*other_hostname)
        console_8bit
	      command ssh "$@"
        console_utf8
	      ;;
    *)  command ssh "$@";;
  esac
}

> 2) is it possible to work out the encoding of a file ?

Not for all encodings, but for utf-8 vs. "that 8 bit encoding that we
use here normally" it shouldn't be a problem with iconv:

iconv -f utf8 -t WINDOWS-1252 "$1" >/dev/null ||
  echo "not an UTF-8 file that can be converted to CP1252"

... where "$1" should be your filename.

> 3) if so it possible to get kate to open the file as the encoding that
> it is currently?

I don't know, sorry.

Regards...
                Michael

___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

[Index of Archives]     [Trinity (TDE) Desktop Users]     [Fedora KDE]     [Fedora Desktop]     [Linux Kernel]     [Gimp]     [GIMP for Windows]     [Gnome]     [Yosemite Hiking]
  Powered by Linux