Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I fix charset problems in .gs script?
    primarykey
    data
    text
    <h1>I have a problem with charsets.</h1> <p>I parsed a csv file in google-app-engine and I'm posting to an uiapp table. But I checked special characters like áéíóú and those are not well displayed (?square symbol).</p> <p>When I was setting up my code I played writing the string imported to a google docs document and it worked the same.</p> <p><strong>some advice please?</strong></p> <h2>I search for:</h2> <ul> <li>a global charset definition to the code. or</li> <li>string var transformation that makes the chars appear like I want to. (avoiding html <code>&amp;number</code> definitions.</li> <li>Is this related to the blob object?</li> </ul> <p><em>The thing is important i come from spain and we need such characters.</em></p> <p><a href="https://script.google.com/macros/s/AKfycbxAoD1qomaL6tJ09pl_dixcUvS1NRqkg1wJroNPNpRM8Qv3mXLu/exec" rel="nofollow" title="app link">app that get's a csv ';' delimited file and shows it's content</a></p> <p>I post all my code, it's barely as the tutorial that is given.</p> <pre><code>function arreglaUrl(cadena){ var texto = cadena[cadena.length - 2] if (texto == ''){ cadena[cadena.length - 2] = 'Sin enlace'; } else{ cadena[cadena.length - 2] = '&lt;center&gt;&lt;a href=\"'+ texto + '\"&gt;Link.&lt;/a&gt;&lt;/center&gt;' ; }; } function parsedCSV(){ var listaArchivos = DocsList.getFolderById('XXXXX').getFiles() for (var i = 0; i &lt; listaArchivos.length; i++) { if (listaArchivos[i].getName() == 'baul.csv'){ var origen = listaArchivos[i]; }; } var texto = origen.getContentAsString(); var arra = Utilities.parseCsv(texto,";"); return(arra); } function doGet() { var datos = parsedCSV() var baul = Charts.newDataTable() for (i = 0; i &lt; datos[0].length; i++){ baul.addColumn(Charts.ColumnType.STRING, datos[0][i]) } for (i = 1; i &lt; datos.length; i++){ arreglaUrl(datos[i]) // this only makes some html i need to post some links baul.addRow(datos[i]) } baul.build(); var sectorFilter = Charts.newCategoryFilter() .setFilterColumnLabel("sector") .build(); var tipoFilter = Charts.newCategoryFilter() .setFilterColumnLabel("tipo") .build(); var searchFilter = Charts.newStringFilter() .setFilterColumnLabel("Titulo") .build(); var searchDesc = Charts.newStringFilter() .setFilterColumnLabel("descripcion") .build(); var tableChart = Charts.newTableChart().setOption('allowHtml', true).setDimensions(0,0) .build(); var dashboard = Charts.newDashboardPanel() .setDataTable(baul) .bind([sectorFilter, tipoFilter, searchFilter, searchDesc], [tableChart]) .build(); var uiApp = UiApp.createApplication().setTitle('Baul de Recursos'); var anchoTotal = '100%'; dashboard.add(uiApp.createVerticalPanel() .add(uiApp.createHorizontalPanel() .add(sectorFilter) .add(tipoFilter) .setSpacing(15) ) .add(uiApp.createHorizontalPanel() .add(searchFilter) .add(searchDesc) .setSpacing(15) ) .add(uiApp.createHorizontalPanel() .add(tableChart).setBorderWidth(1).setHorizontalAlignment(UiApp.HorizontalAlignment.CENTER).setWidth(anchoTotal) ) ); uiApp.add(dashboard); return uiApp; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload