Skip to content
Permalink
Browse files

Replace unicode by Unicode

  • Loading branch information
DelazJ committed Dec 29, 2016
1 parent c301369 commit a56f928f716cf2f1185eb3d101958d208d5ed766
@@ -1448,7 +1448,7 @@ DOT_NUM_THREADS = 0

# By default doxygen will write a font called FreeSans.ttf to the output
# directory and reference it in all dot files that doxygen generates. This
# font does not include all possible unicode characters however, so when you need
# font does not include all possible Unicode characters however, so when you need
# these (or just want a differently looking font) you can specify the font name
# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
# which can be done by putting it in a standard location or by setting the
@@ -89,7 +89,7 @@ def data(self, index, role):
# too much data to display, elide the string
val = val[:300]
try:
return str(val) # convert to unicode
return str(val) # convert to Unicode
except UnicodeDecodeError:
return str(val, 'utf-8', 'replace') # convert from utf8 and replace errors (if any)

@@ -133,7 +133,7 @@ def processAlgorithm(self, progress):
y = str(comparisonvalue)
except ValueError:
selectionError = True
msg = self.tr('Cannot convert "%s" to unicode' % str(comparisonvalue))
msg = self.tr('Cannot convert "%s" to Unicode' % str(comparisonvalue))
elif selectType == QVariant.Date:
# date
dateAndFormat = comparisonvalue.split(' ')
@@ -23,15 +23,15 @@
Usage: compareVersions(version1, version2)
The function accepts arguments of any type convertable to unicode string
The function accepts arguments of any type convertable to Unicode string
and returns integer value:
0 - the versions are equal
1 - version 1 is higher
2 - version 2 is higher
-----------------------------------------------------------------------------
HOW DOES IT WORK...
First, both arguments are converted to uppercase unicode and stripped of
First, both arguments are converted to uppercase Unicode and stripped of
'VERSION' or 'VER.' prefix. Then they are chopped into a list of particular
numeric and alphabetic elements. The dots, dashes and underlines are recognized
as delimiters. Also numbers and non numbers are separated. See example below:
@@ -269,7 +269,7 @@ QgsPostgresConn::QgsPostgresConn( const QString& conninfo, bool readOnly, bool s
return;
}

//set client encoding to unicode because QString uses UTF-8 anyway
//set client encoding to Unicode because QString uses UTF-8 anyway
QgsDebugMsg( "setting client encoding to UNICODE" );
int errcode = PQsetClientEncoding( mConn, QStringLiteral( "UNICODE" ).toLocal8Bit() );
if ( errcode == 0 )
@@ -546,7 +546,7 @@ QString QgsPythonUtilsImpl::PyObjectToQString( PyObject* obj )
}

// it's some other type of object:
// convert object to unicode string (equivalent to calling unicode(obj) )
// convert object to Unicode string (equivalent to calling unicode(obj) )
PyObject* obj_uni = PyObject_Unicode( obj ); // obj_uni is new reference
if ( obj_uni )
{
@@ -564,7 +564,7 @@ QString QgsPythonUtilsImpl::PyObjectToQString( PyObject* obj )
}
#endif

// if conversion to unicode failed, try to convert it to classic string, i.e. str(obj)
// if conversion to Unicode failed, try to convert it to classic string, i.e. str(obj)
PyObject* obj_str = PyObject_Str( obj ); // new reference
if ( obj_str )
{
@@ -573,7 +573,7 @@ QString QgsPythonUtilsImpl::PyObjectToQString( PyObject* obj )
return result;
}

// some problem with conversion to unicode string
// some problem with conversion to Unicode string
QgsDebugMsg( "unable to convert PyObject to a QString!" );
return QStringLiteral( "(qgis error)" );
}

0 comments on commit a56f928

Please sign in to comment.
You can’t perform that action at this time.