Skip to content

WordPressBase __repr__ needs revision #49

@macedd

Description

@macedd

In order to represent an Object the system do:

  1. Return a property string from WordPressChildClass.__str__
  2. Convert self.__str__ to ascii (str(self))
  3. Convert ascii self to utf-8 (.encode('UTF-8'))

Which IMHO is totally wrong because:

  • the majority of wordpress blogs defaults to UTF-8 data - and it can't be fully converted to ascii.
  • if converting to ascii, why bring back to utf-8?

I'm currently not sure if any unicode conversion is made in the request/response processes (the data [eg. self.title] is already unicode, which is great).

That being said the fix I've used is this commit. But I have also make sure to convert all the classes.str output to utf-8.

In fact I'm really not sure if converting all data to utf-8 will catch all WP encoding cases (surely most of them). There is some info about encodings and WordPress in the following links

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions