View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
05113Bug reportsImport/Exportpublic2011-05-04 19:47
Reporterpeterhol Assigned Todionet  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.91RC6 
Fixed in Version1.91 
Summary05113: Wrong text encoding for exported Surveydata_syntax.R
Description

When exporting data to R, the fil "Surveydata_syntax.R" is in "Western (Mac OS Roman)" text encoding. When running source("Surveydata_syntax.R", encoding = "UTF-8"), I get an error message from R. To make it work, I have to convert the file to UTF-8 in a text editor... the data is exported in utf-8 encoding, so that is not a problem (all the tables in the limesurvey database are utf8_unicode_ci).

Steps To Reproduce
  1. Create survey.
  2. Gather responses.
  3. Export results to R.
TagsNo tags attached.
Attached Files
export_data_r.diff (760 bytes)   
Index: export_data_r.php
===================================================================
--- export_data_r.php	(revision 9945)
+++ export_data_r.php	(working copy)
@@ -219,10 +219,10 @@
 
       echo 'attributes(data)$variable.labels[' . $i . '] <- "'
               . addslashes(
-                  htmlspecialchars_decode(utf8_decode(
+                  htmlspecialchars_decode(
                     mb_substr(
                       strip_tags_full(
-                        $field['VariableLabel']),0,$length_varlabel))))  // <AdV> added htmlspecialchars_decode
+                        $field['VariableLabel']),0,$length_varlabel)))  // <AdV> added htmlspecialchars_decode
               . '"' . "\n";
 
       // Create the value Labels!
export_data_r.diff (760 bytes)   
Bug heat4
Complete LimeSurvey version number (& build)10000
I will donate to the project if issue is resolvedNo
Browserchrome on a mac
Database type & versionmysql 5.0.91, 145
Server OS (if known)linux
Webserver software & version (if known)Apache/2.2.17
PHP Version5.2.16

Users monitoring this issue

There are no users monitoring this issue.

Activities

dionet

dionet

2011-04-15 17:46

reporter   ~14821

Patch uploaded. There was an unnecessary utf8_decode function breaking file encoding.

c_schmitz

c_schmitz

2011-04-16 16:58

administrator   ~14827

Looks good - please commit.

c_schmitz

c_schmitz

2011-04-16 16:58

administrator   ~14828

Also don't forget to apply the change to the _dev branch, too.

Issue History

Date Modified Username Field Change
2011-04-14 09:48 peterhol New Issue
2011-04-14 11:44 c_schmitz Assigned To => dionet
2011-04-14 11:44 c_schmitz Status new => assigned
2011-04-15 17:44 dionet File Added: export_data_r.diff
2011-04-15 17:46 dionet Note Added: 14821
2011-04-15 23:35 dionet Assigned To dionet => c_schmitz
2011-04-16 16:58 c_schmitz Note Added: 14827
2011-04-16 16:58 c_schmitz Note Added: 14828
2011-04-16 16:58 c_schmitz Assigned To c_schmitz => dionet
2011-04-17 00:57 dionet Status assigned => resolved
2011-04-17 00:57 dionet Resolution open => fixed
2011-05-04 19:47 c_schmitz Status resolved => closed
2011-05-04 19:47 c_schmitz Fixed in Version => 1.91