Revision: 3161
Author: jussi.ao.malinen
Date: Wed May 5 00:11:57 2010
Log: Now all strings are normalized to nfc form. This fixes unicode tests
on mac.
http://code.google.com/p/robotframework/source/detail?r=3161
Modified:
/trunk/atest/resources/atest_resource.txt
/trunk/atest/robot/parsing/unicode_in_paths.txt
/trunk/src/robot/utils/unic.py
=======================================
--- /trunk/atest/resources/atest_resource.txt Wed Apr 14 02:27:24 2010
+++ /trunk/atest/resources/atest_resource.txt Wed May 5 00:11:57 2010
@@ -149,7 +149,7 @@
[Arguments] ${path}
[Documentation] Output encoding avare helper
${encoding} = Evaluate
__import__('robot').utils.encoding._output_encoding
- ${encoding} = Set Variable If '${path}' in ['${STDERR
FILE}','${STDOUT FILE}']
+ ${encoding} = Set Variable If '${path}' in ['${STDERR
FILE}','${STDOUT FILE}','${SYSLOG FILE}']
... ${encoding} UTF-8
${file} = Log File ${path} ${encoding}
[Return] ${file}
=======================================
--- /trunk/atest/robot/parsing/unicode_in_paths.txt Mon Apr 12 08:20:36 2010
+++ /trunk/atest/robot/parsing/unicode_in_paths.txt Wed May 5 00:11:57 2010
@@ -1,4 +1,4 @@
-*** Settings ***
+*** Settings ***
Force Tags regression pybot jybot
Suite Setup Run Tests --log ulog.html --report ureport.html
parsing/unicode_paths/testäö.txt parsing/unicode_paths/Työ
Resource atest_resource.txt
@@ -28,5 +28,6 @@
Failures processing files are handled gracefully
${path} = Normalize Path
${CURDIR}/../../testdata/parsing/unicode_paths/Työ/tyhjä.txt
- ${path} = Set Variable If __import__('os').name == 'nt'
${path.lower()} ${path}
+ ${path} = Set Variable If
__import__('robot').utils.normalizing._CASE_INSENSITIVE_FILESYSTEM
+ ... ${path.lower()} ${path}
Check syslog contains Parsing data source '${path}' failed: Test case
file '${path}' contains no test cases.
=======================================
--- /trunk/src/robot/utils/unic.py Fri Apr 16 04:53:28 2010
+++ /trunk/src/robot/utils/unic.py Wed May 5 00:11:57 2010
@@ -13,12 +13,13 @@
# limitations under the License.
import sys
+import unicodedata
def unic(item, *args):
# Based on a recipe from http://code.activestate.com/recipes/466341
try:
- return unicode(item, *args)
+ return unicodedata.normalize("NFC",unicode(item, *args))
except UnicodeError:
try:
ascii_text = str(item).encode('string_escape')