Encoding of CAPI questions

Discussions about creating CAPI applications to run on Android devices
Post Reply
wimneel
Posts: 27
Joined: May 6th, 2017, 5:31 am

Encoding of CAPI questions

Post by wimneel » July 9th, 2019, 5:10 pm

I recently made an Android application, using CSPro 7.2, but based on an older application, made in 6.3. It is working fine. It uses only one language – Portuguese – in the questions, value sets and error messages. Now I want to have a paper version of the questionnaire and for that I hoped to use ExportXMLMetadata.exe to export the questionnaire as an HTML file, which is then to be transformed into PDF. ExportXMLMetadata.exe asks for a dictionary file (.dcf) and for a question file (.ent.qsf).
I had a look inside the .qsf file and noted that the question text is encoded differently, like in this question:

[QUESTION]
Field=APLICATIONNAME_DICT.P42C
POR={\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang2057{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\fnil\fcharset0 Arial;}}
POR={\colortbl ;\red0\green0\blue0;\red0\green0\blue255;}
POR={\*\generator Riched20 10.0.16299}\viewkind4\uc1
POR=\pard\cf1\f0\fs29\lang2070 c. Com que frequ\'eancia o pessoal do Munic\'edpio est\'e1 \b ausente\b0 ?\par
POR=\cf2\i\f1\fs24 (Ler as op\'e7\'f5es)\cf1\i0\f0\fs29\par
POR=}

In the application this question is shown correctly as:
c. Com que frequência o pessoal do Município está ausente?
But in the HTML file it is rendered as
c. Com que frequ�ncia o pessoal do Munic�pio est� ausente?

What can I do to get the question text rendered correctly?

Gregory Martin
Posts: 1221
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Encoding of CAPI questions

Post by Gregory Martin » July 10th, 2019, 11:36 am

You're right that this is a problem. I've fixed the problem, which will go out in CSPro 7.3. I've posted the 7.3 version here:

https://drive.google.com/open?id=1NVnTg ... lEiSVcqa7w

You can run the program in that file and it should give you the correct results. If not, please let me know.

vipul315singhal
Posts: 19
Joined: March 28th, 2013, 9:17 am

Re: Encoding of CAPI questions

Post by vipul315singhal » July 12th, 2019, 7:39 am

Hi Gregory,

Happy to hear about updated version 7.3 .
Thanks for the updated ExportXMLMetadata.exe. I exported my questionnaire with this and found that value label (Don't Know is exporting as Don’t know) in html. Requesting you to fix the same.
Also is there any way by which we can export Local language written in CAPI Question of the variable. Like I have putted Bangla as another language in CAPI question is not getting exported in HTML. Attaching screenshot.

Many thanks!

Regards
Vipul
Attachments
a.png
a.png (36.82 KiB) Viewed 332 times

wimneel
Posts: 27
Joined: May 6th, 2017, 5:31 am

Re: Encoding of CAPI questions

Post by wimneel » July 12th, 2019, 9:18 am

Thank you very much, Gregory!
This works perfectly.

Gregory Martin
Posts: 1221
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Encoding of CAPI questions

Post by Gregory Martin » July 15th, 2019, 8:40 am

vipul315singhal, can you send your dictionary to cspro@lists.census.gov? I'll fix the problem if I can recreate it.

Regarding exporting to the other languages, when you email the above address, please request that feature. The ExportXMLMetadata tool is very incomplete, and was really designed for other purposes. I think that what most users want is some kind of "questionnaire printer," so if enough users request it, it might get added to a future version of CSPro. This would definitely support exports to multiple languages.

Post Reply