tomchristie/django-rest-framework — pull request #672 by wronglink (2013-02-22 12:55:33+00:00)
Title: Fixed UnicodeDecodeError on get_name and get_description methods

If you try to use non-ascii encoded stiring in docstrings to your views. Here is a sample:

```python
# -*- coding: utf-8 -*-

@api_view(('GET',))
def api_root(request, format=None):
"""
Проверка
"""
...
```

You'll get a `UnicodeDecodeError` on your browsable api page:
```
Traceback (most recent call last):
File "/Users/wronglink/Src/django-rest-framework/rest_framework/response.py", line 44, in rendered_content
return renderer.render(self.data, media_type, context)
File "/Users/wronglink/Src/django-rest-framework/rest_framework/renderers.py", line 437, in render
description = self.get_description(view)
File "/Users/wronglink/Src/django-rest-framework/rest_framework/renderers.py", line 407, in get_description
return view.get_description(html=True)
File "/Users/wronglink/Src/django-rest-framework/rest_framework/views.py", line 111, in get_description
description = _remove_leading_indent(description)
File "/Users/wronglink/Src/django-rest-framework/rest_framework/views.py", line 35, in _remove_leading_indent
for line in content.splitlines()[1:] if line.lstrip()]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 4: ordinal not in range(128)
```

It could be fixed by unicode docstring, but django has it's own unicode forcing util, that will do most of the work.

P.S.
BTW isn't that a mistake that `rest_framework.renderers.BrowsableAPIRenderer.get_name` method returns `view.__doc__` (not something like `view.__class__.__name__` as `rest_framework.views.APIView.get_name` does)?