bad encoding with printing a datatable in R shiny
<p>first, sorry for my english because I'm not englophone. And this leads to my problem, in my language, we use accent and other particular characters.
I need to print a data.frame on a shiny datatable (renderDataTable), and some accents are not printed correctly.
<a href="http://i.stack.imgur.com/og0xN.png" rel="nofollow">Exemple of lines bas printed, eg 10, 11, 12, 13, 14</a></p>

<p>Here is my code, which is inspired from the example of 
Rshiny web site, ref renderDataTable:</p>

<pre><code>.libPaths("C:/R_library")
library(shiny)
niveau3 &lt;- read.csv2("Libelle_NC.txt", encoding="UTF-8", header = FALSE, sep = ";", na.strings = "", stringsAsFactors = TRUE)

ui &lt;- fluidPage(
    fluidRow(
        column(12,
               dataTableOutput("table"),
        )
    )

)

server &lt;- function(input, output) {

    output$table &lt;- renderDataTable(
        {
             niveau3
        },
        options = list(
            pageLength = 15,
            initComplete = I("function(settings, json) {alert('Done.');}")
        )
    )

    output$tableAsiat &lt;- renderDataTable({
        asiat
    })
}

shinyApp(ui= ui , server=server)
</code></pre>

<p>The file Libelle_NC.txt can be found on the first zip of the <a href="https://www.data.gouv.fr/fr/datasets/statistiques-nationales-du-commerce-exterieur/" rel="nofollow">link towards data gouvernement of exportation/importation</a></p>

<p>The problem is that it seems there is non regularity of the displayed lines:
for exemple line 9 of the rendered table print correctely "...(à..." but not for for line 10.</p>

<p>I look for options to be coded in <code>options=list()</code> part of function <code>renderDataTable</code> on the option reference link of jQuery DataTable page.
And I didn't find any option about encoding.</p>

<p>I was thinking that it was due to the <code>read.csv</code> function which didnt' encode correctly, but a <code>View(niveau3)</code> show a well printed data.frame.</p>

<p>Is there any manipulation or option that played on the encoding of a <code>renderDataTable()</code>, or should I treat the data.frame before print process?</p>

<p>Thank you.</p>