# class KRemoteEncoding

###

Module | kio
Namespace |
Class | KRemoteEncoding
Inherits |

Allows encoding and decoding properly remote filenames into Unicode.

Certain protocols do not specify an appropriate encoding for decoding their 8-bit data into proper Unicode forms. Therefore, ioslaves should use this class in order to convert those forms into QStrings before creating the respective KIO.UDSEntry. The same is true for decoding URLs to its components.

Each KIO.SlaveBase has one object of this kind, even if it is not necessary. It can be accessed through KIO.SlaveBase.remoteEncoding.

A class for handling remote filenames Author Thiago Macieira <thiago.macieira@kdemail.net>

### methods

- KRemoteEncoding (name)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  name | char | 0

  Constructor.

  Constructs this object to use the given encoding name. If name is a null pointer, the standard encoding will be used.

- KRemoteEncoding (a0)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | KRemoteEncoding |

- KRemoteEncoding (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | char | 0

- decode (name)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  name | QByteArray |

  Converts the given full pathname or filename to Unicode. This function is supposed to work for dirnames, filenames or a full pathname.

- directory (url, ignore_trailing_slash)

  returns QByteArray

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |
  ignore_trailing_slash | bool | 1

  Converts the given URL into 8-bit form and separate the dirname from the filename. This is useful for slave functions like stat or get.

  The dirname is returned with the final slash always stripped

- encode (name)

  returns QByteArray

  Argument | Type | Default
  --- | --- | ---
  name | QString |

  Converts the given name from Unicode. This function is supposed to work for dirnames, filenames or a full pathname.

- encode (url)

  returns QByteArray

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |

  Converts the given URL into its 8-bit components

- encoding ( )

  returns char

  Returns the encoding being used.

- encodingMib ( )

  returns int

  Returns the MIB for the codec being used.

- fileName (url)

  returns QByteArray

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |

  Converts the given URL into 8-bit form and retrieve the filename.

- setEncoding (name)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  name | char |

  Sets the encoding being used. This function does not change the global configuration.

  Pass a null pointer in name to revert to the standard encoding.

- virtual_hook (id, data)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  id | int |
  data | void |