<font size=2 face="sans-serif">Chris ,</font>
<br>
<br><font size=2 face="sans-serif">I just realised I only included Ian
on this - this is my fuller answer.</font>
<br>
<br><font size=2 face="sans-serif">I am a python novice I am just using
it via </font><a href=http://xlsxwriter.readthedocs.org/><font size=2 face="Courier New">http://xlsxwriter.readthedocs.org/</font></a><font size=2 face="sans-serif">
to produce a .xlsx spreadsheet &nbsp;- the </font><font size=2 color=blue face="sans-serif">Ä</font><font size=2 face="sans-serif">
&nbsp; &nbsp; went directly to the python code which objected to it. when
it was run </font>
<br><font size=2 color=blue face="Courier New">$python test.py </font>
<br>
<br><font size=2 face="sans-serif">thanks </font>
<br><font size=2 face="sans-serif">Allan</font>
<br>
<br>
<br><font size=1 color=#800080 face="sans-serif">----- Forwarded by Allan
Biggs/GB/CONT/DPT on 14/04/2016 16:55 -----</font>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Allan Biggs/GB/CONT/DPT</font>
<br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Ian Kirkham &lt;Ian.Kirkham@actian.com&gt;@DUPONT_MHUB</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">14/04/2016 16:30</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">RE: [Info-ingres]
replacing special characters &nbsp;eg ä &nbsp;in SQL with a unicode script
u'ä'</font>
<br>
<hr noshade>
<br>
<br><font size=2 face="Courier New">Ian,</font>
<br>
<br><font size=2 face="Courier New">I am using report writer to create
a python script &nbsp;(test.py) which is then run by python</font>
<br>
<br><font size=2 color=blue face="Courier New">$python test.py </font>
<br>
<br><font size=2 face="Courier New">to produce an .xlsx spreadsheet. All
on linux </font>
<br>
<br><font size=2 face="Courier New">see </font><a href=http://xlsxwriter.readthedocs.org/><font size=2 face="Courier New">http://xlsxwriter.readthedocs.org/</font></a><font size=2 face="Courier New">
its a really easy way of generating .xlsx files from pure script. </font>
<br>
<br><font size=2 face="Courier New">I needed to put the registered mark
&nbsp;® into the spreadsheet and found the only way I could do this was
</font>
<br>
<br><font size=2 face="Courier New">this ..... </font>
<br><font size=2 color=blue face="Courier New">worksheet1.write( &nbsp;43,
&nbsp; 0,'xxxx' u'®' &nbsp;'and xxxx' u'®' &nbsp;' are registered trademarks
of xxxxxxxxx.' ,format0)</font>
<br><font size=2 color=blue face="Courier New">worksheet1.write( &nbsp;44,
&nbsp; 0,'Only xxxxxx makesxxxxx' u'®' ' brand and xxxxxx ' u'®' 'xxxxxx',format0)</font>
<br>
<br><font size=2 face="Courier New">..... works very well but in final
testing we discovered that certain orders did not run and that an A Umlaut
in the customer data stopped the python script working </font>
<br>
<br><font size=2 face="Courier New">Oh - the python has to have &nbsp;this
as the first line </font>
<br>
<br><font size=2 color=blue face="Courier New"># _*_ coding: utf-8</font>
<br>
<br><font size=2 face="Courier New">..... I tried this quickly </font>
<br><font size=2 color=blue face="sans-serif">worksheet1.write( &nbsp;44,
&nbsp; 0,'Only xxxxxx makesxxxxx' u'®' ' br u'Ä' nd and xxxxxx ' u'®'
'xxxxxx',format0)</font>
<br>
<br>
<br><font size=2 face="Courier New">which works.</font>
<br>
<br><font size=2 face="Courier New">&nbsp;Ingres was happy to pass the
umlauts on , its the python that was unhappy. </font>
<br>
<br><font size=2 face="Courier New">I am half way through modifying the
sql like this to replace the umlaut characters but I would like to have
found a more generic solution </font>
<br><font size=2 face="Courier New">not sure that this will work when put
into a string (there are a lot of '''''s around) :-) </font>
<br>
<br><font size=2 color=blue face="Courier New">update rxrpy_w_rrp set cons_cust
&nbsp;= replace(cons_cust,'ä','u''ä'''); </font>
<br><font size=2 color=blue face="Courier New">update rxrpy_w_rrp set cons_town
&nbsp;= replace(cons_town,'ä','u''ä'''); </font>
<br><font size=2 color=blue face="Courier New">update rxrpy_w_rrp set cons_ctry
&nbsp;= replace(cons_ctry,'ä','u''ä'''); </font>
<br><font size=2 color=blue face="Courier New">update rxrpy_w_rrp set cust_ref
&nbsp; = replace(cust_ref,'ä','u''ä'''); </font>
<br><font size=2 color=blue face="Courier New">update rxrpy_w_rrp set cust_ordno
= replace(cust_ordno,'ä','u''ä'''); </font>
<br>
<br><font size=2 color=blue face="Courier New">update rxrpy_w_rrp set cons_cust
&nbsp;= replace(cons_cust,'Ä','u''Ä'''); </font>
<br><font size=2 color=blue face="Courier New">update rxrpy_w_rrp set cons_town
&nbsp;= replace(cons_town,'Ä','u''Ä'''); </font>
<br><font size=2 color=blue face="Courier New">update rxrpy_w_rrp set cons_ctry
&nbsp;= replace(cons_ctry,'Ä','u''Ä'''); </font>
<br><font size=2 color=blue face="Courier New">update rxrpy_w_rrp set cust_ref
&nbsp; = replace(cust_ref,'Ä','u''Ä'''); </font>
<br><font size=2 color=blue face="Courier New">update rxrpy_w_rrp set cust_ordno
= replace(cust_ordno,'Ä','u''Ä'''); </font>
<br>
<br><font size=2 color=blue face="Courier New">\p\g</font>
<br>
<br><font size=2 face="Courier New">&nbsp;</font>
<br><font size=2 face="Courier New">forgive the redactions there is customer
specific data in here &nbsp;- I would send you the python script but cannot
for the same reason ... </font>
<br>
<br><font size=2 face="Courier New">thanks</font>
<br><font size=2 face="Courier New">Allan</font>
<br>
<br>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Ian Kirkham &lt;Ian.Kirkham@actian.com&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Allan Biggs &lt;Allan.Biggs@GBR.dupont.com&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">14/04/2016 15:55</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">RE: [Info-ingres]
replacing special characters &nbsp;eg ä &nbsp;in SQL with a unicode script
u'ä'</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=2 color=#004080 face="Calibri">This really depends on what
you are trying to achieve.</font>
<br><font size=2 color=#004080 face="Calibri">UTF-8 handles these very
well so what is the problem that makes you want to embed quotes around
them?</font>
<br><font size=2 color=#004080 face="Calibri">Are you talking about the
constants in a query or the data in the tables?</font>
<br><font size=2 color=#004080 face="Calibri">Or is it that you really
want to transfer the data in ASCII to avoid problems with handling 8-bit
data?</font>
<br><font size=2 color=#004080 face="Calibri">&nbsp;</font>
<br><font size=2 color=#004080 face="Calibri">Regards,</font>
<br><font size=2 color=#004080 face="Calibri">Ian</font>
<br><font size=2 color=#004080 face="Calibri">&nbsp;</font>
<br><font size=2 face="Calibri"><b>From:</b> info-ingres-bounces@lists.planetingres.org
[</font><a href="mailto:info-ingres-bounces@lists.planetingres.org"><font size=2 face="Calibri">mailto:info-ingres-bounces@lists.planetingres.org</font></a><font size=2 face="Calibri">]
<b>On Behalf Of </b>Allan Biggs<b><br>
Sent:</b> 14 April 2016 15:24<b><br>
To:</b> info-ingres@lists.planetingres.org<b><br>
Subject:</b> [Info-ingres] replacing special characters eg ä in SQL with
a unicode script u'ä'</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=2 face="Arial">Is there a way of replacing characters such
as </font><a href=https://en.wikipedia.org/wiki/%C3%84><font size=3 color=blue face="Times New Roman"><u>ä
</u></font></a><font size=2 face="Arial">&nbsp;(a umlaut) as part of an
SQL query. </font><font size=3 face="Times New Roman"><br>
</font><font size=2 face="Arial"><br>
We are sometimes fed these characters by another system, </font><font size=3 face="Times New Roman"><br>
</font><font size=2 face="Arial"><br>
in my case I am producing a python script which for </font><font size=3 color=blue face="Times New Roman">ä
</font><font size=3 face="Times New Roman">needs to be represented by the
string u'</font><a href=https://en.wikipedia.org/wiki/%C3%84><font size=3 color=blue face="Times New Roman"><u>ä</u></font></a><font size=3 face="Times New Roman">'
or substituted for a none unicode character. <br>
<br>
</font><font size=2 face="Arial"><br>
clearly I can do something like </font><font size=3 face="Times New Roman"><br>
</font><font size=2 face="Arial"><br>
update filename_w_asd &nbsp;set file_name = replace(file_name,'</font><font size=3 color=blue face="Times New Roman">ä</font><font size=2 face="Arial">','</font><font size=3 color=blue face="Times New Roman">''ä</font><font size=2 face="Arial">''');</font><font size=3 face="Times New Roman">
</font><font size=2 face="Arial"><br>
\p\g</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="Arial"><br>
but is there a more generic way to do this?</font><font size=3 face="Times New Roman">
<br>
</font><font size=2 face="Arial"><br>
Allan </font>
<p><font size=3 face="Times New Roman"><br>
This communication is for use by the intended recipient and contains<br>
information that may be Privileged, confidential or copyrighted under<br>
applicable law. If you are not the intended recipient, you are hereby<br>
formally notified that any use, copying or distribution of this e-mail,<br>
in whole or in part, is strictly prohibited. Please notify the sender by<br>
return e-mail and delete this e-mail from your system. Unless explicitly<br>
and conspicuously designated as &quot;E-Contract Intended&quot;, this e-mail
does<br>
not constitute a contract offer, a contract amendment, or an acceptance<br>
of a contract offer. This e-mail does not constitute a consent to the<br>
use of sender's contact information for direct marketing purposes or for<br>
transfers of data to third parties.</font>
<p><font size=3 face="Times New Roman">Francais Deutsch Italiano &nbsp;Espanol
&nbsp;Portugues &nbsp;Japanese &nbsp;Chinese &nbsp;Korean</font>
<p><font size=3 face="Times New Roman">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</font><a href=http://www.dupont.com/corp/email_disclaimer.html><font size=3 color=blue face="Times New Roman"><u>http://www.DuPont.com/corp/email_disclaimer.html</u></font></a>
<p><p><br>
This communication is for use by the intended recipient and contains<br>
information that may be Privileged, confidential or copyrighted under<br>
applicable law. If you are not the intended recipient, you are hereby<br>
formally notified that any use, copying or distribution of this e-mail,<br>
in whole or in part, is strictly prohibited. Please notify the sender by<br>
return e-mail and delete this e-mail from your system. Unless explicitly<br>
and conspicuously designated as "E-Contract Intended", this e-mail does<br>
not constitute a contract offer, a contract amendment, or an acceptance<br>
of a contract offer. This e-mail does not constitute a consent to the<br>
use of sender's contact information for direct marketing purposes or for<br>
transfers of data to third parties.</p>


<p>Francais Deutsch Italiano&nbsp; Espanol&nbsp; Portugues&nbsp; Japanese&nbsp; Chinese&nbsp; Korean</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  http://www.DuPont.com/corp/email_disclaimer.html</p>