<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#0060bf;">Hey Olivier,<br><br>I was checking about the per layer encoding.<br><br>First, when I've added the encoding attribute in the config.xml file, it was to be able to pull data from <br>the server with the GetFeature request.<br><br>This because I noticed that Quantum GIS wasn't loading my data complete. Doing some tests with <br>the GetFeature request with a browser, there was a parsing error with no <span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">UTF-8</span> characters.<br><br>That problem was now fixed with the changes I made, you can check at <br><br><span> <a target="_blank"
href="http://sitel.jalisco.gob.mx/cgi-bin/wfst2?SERVICE=WFS&VERSION=1.0.0&REQUEST">http://sitel.jalisco.gob.mx/cgi-bin/wfst2?SERVICE=WFS&VERSION=1.0.0&REQUEST</a>=</span><br> GetFeature&TYPENAME=sitel:acatic_manzanas<br><br>to see that the TinyOWS generated XML response handles the encoding <span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">ISO-8859-1</span> that I've <br>defined into my config.xml file.<br><br>Also, if you type <span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">./wfst2 --check</span> it dumps the encoding too:<br><br><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">TinyOWS version: 0.9.0</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">Config File Path:
/usr/local/tinyows/config.xml</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">PostGIS dsn: host=127.0.0.1 ...</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">Schema dir: /usr/local/tinyows/schema/</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">Log file: /usr/local/tinyows/tinyows.log</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">Encoding:
ISO-8859-1</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">Available layers:</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> - public.acatic_manzanas -> 32613 RW</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> - public.acatic_cultivos -> 32613 RW</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> - public.acatic_curvas_nivel_maestras -> 32613 RW</span><br><br>Now, handling encoding per layer needs to specify per table PostgreSQL encodings, is not possible <br>because you can only set the
encoding to the whole database.<br><br>Also, there's no necessarily match between the XML encoding and the PostgreSQL encoding.<br><br>Lets say: <br><br>I need to handle the XML responses with an encoding that supports french and spanish special <br>characters, so I have to choose <span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">ISO-8859-1</span>, but, I have my database configured as <span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">LATIN-1</span><br>or <code style="font-family: Courier New,courier,monaco,monospace,sans-serif;" class="literal">WIN1252</code>. It doesn't match.<br><br>So I suggest to add into the <span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">pg</span> tag an encoding attribute, like this:<br><pre class="wiki"><pg host="127.0.0.1" user="postgres" password="postgres" <br> dbname="tinyows_demo" port="5432"
encoding="LATIN-1"/><br><span style="font-family: arial,helvetica,sans-serif;"><br>With this change, I just can call the <span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">PQsetClientEncoding</span> function </span><span style="font-family: arial,helvetica,sans-serif;">after the connection is <br>open.<br><br>What do you think ?</span><br><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">There's another thing I'm seeing with the transaction code. It will be wise to use SELECT ... WITH <br>UPDATE specification and also adding LOCKs while update or delete rows, </span><span style="font-family: arial,helvetica,sans-serif;">to avoid concurrency <br>problems</span>.<br><span style="font-family: arial,helvetica,sans-serif;"><br>However, </span><span style="font-family: arial,helvetica,sans-serif;">this change might affect a little bit the performance (because the locks) but
</span><span style="font-family: arial,helvetica,sans-serif;">enhancing the <br>data consistency.<br><br>I'm currently doing some tests with that.<br style="font-family: arial,helvetica,sans-serif;"></span></pre><div style="font-weight: bold;">IC Carlos Ruiz</div><div style="font-weight: bold;"></div></div><br>
</body></html>