sqlite3 support unicode

set text_factory to unicode and then the sqlite3 module will return
Unicode objects for TEXT
ref: http://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.text_factory

Also update the test case for unicode test.

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Reviewed-by: Adam Litke <agl@linux.vnet.ibm.com>
Reviewed-by: Aline Manera <alinefm@linux.vnet.ibm.com>
Reviewed-by : Meina Zhou <zhoumein@linux.vnet.ibm.com>
Reviewed-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>
Tested-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>
support create a vm with unicode name

One principle:
We should audit the code in order to properly handle unicode throughout.
This means always calling var.decode('utf-8') on incoming text and
var.encode('utf-8') on outgoing text.

For incoming text:
The json body from the UI client is unicode, is decoded by incoming
filter (parse_request).
The URL from the UI client is str, need decode.
The text form libvirt is str, need decode.

For outgoing text:
Outgoing text to libvirt, such as xml or VM name should be encode.
Outgoing text to UI should be encode by template render.

At last we should achieve:
All text strings, everywhere should be of type unicode, not str.
If you're handling text, and your variable is a str, it's a bug!

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Signed-off-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>
Reviewed-by: Aline Manera <alinefm@linux.vnet.ibm.com>
Reviewed-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>
Tested-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>
mockmodel support a VM with ww language name

principle:
   We should audit the code in order to properly handle unicode throughout.
   This means always calling var.decode('utf-8') on incoming text and
   var.encode('utf-8') on outgoing text.

   All text strings in other code should be of type unicode, not str.

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
test case for creating a vm with unicode name

Make sure we can create a vm with unicode name.

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Reviewed-by: Aline Manera <alinefm@linux.vnet.ibm.com>
Reviewed-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>
Tested-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>