shinyapps.io hungarian encoding

212 views
Skip to first unread message

Ádám Gmoser

unread,
May 9, 2015, 4:42:54 AM5/9/15
to shinyap...@googlegroups.com
Hi,

I have problem with hungarian character encoding. When I run my app locale, there is no problem, but when I upload to shinyapps.io the special hungarian characters displayed in wrong form.
I tried to be set a lot of encoding types with iconv(), but always the same problem. (Windows-1250, latin2 etc.)
e.g. textCorpus = tm_map(textCorpus, content_transformer(function(x) iconv(x, to="ISO-8859-2", sub='byte')), mc.cores=1)

Are there any possibility to display hungarian characters in the shinyapps.io?

Thanks.

Andy Kipp

unread,
May 11, 2015, 9:44:55 AM5/11/15
to Ádám Gmoser, shinyap...@googlegroups.com
We've recently improved support for detecting and installing locales on shinyapps.io. Can you try upgrading to the latest version of the shinyapps package:

devtools::install_github('rstudio/shinyapps')

After then, can you run:

shinyapps:::detectLocale()

And let me know what the output is.

-Andy


--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/5c317345-af82-476f-a8a9-1c164e3fc8f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ádám Gmoser

unread,
May 11, 2015, 12:59:17 PM5/11/15
to shinyap...@googlegroups.com, adamg...@gmail.com
Hi Andy,

I upgrade the shinyapps package with some warning message about Rtools, but the upgrade was done.

WARNING: Rtools is required to build R packages, but is not currently installed.

Please download and install Rtools 3.1 from http://cran.r-project.org/bin/windows/Rtools/ and then run find_rtools().
Downloading github repo rstudio/shinyapps@master
Installing shinyapps
"C:/PROGRA~1/R/R-31~1.3/bin/x64/R" --vanilla CMD INSTALL  \
  "C:/Users/rstudio/AppData/Local/Temp/RtmpmgFaVO/devtools7ec63bce85/rstudio-shinyapps-cbf6fad"  \
  --library="C:/Users/rstudio/Documents/R/win-library/3.1" --install-tests 

After that I run shinyapps:::detectLocale()

My output is:

Detecting system locale ... [1] "en_US"
Warning message:
Unable to detect locale. Using default: en_US

Thanks for helping, I am waiting for yout advice.

Adam

Andy Kipp

unread,
May 11, 2015, 2:02:55 PM5/11/15
to Ádám Gmoser, shinyap...@googlegroups.com
Hi,

Can you send the output for

shinyapps:::systemInfo()

Thanks
-Andy

Ádám Gmoser

unread,
May 11, 2015, 2:13:07 PM5/11/15
to shinyap...@googlegroups.com, adamg...@gmail.com
Hi,

the output is:

Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  incomplete final line found by readTableHeader on 'raw'

I don't know what is the problem.

Adam

Andy Kipp

unread,
May 11, 2015, 2:30:50 PM5/11/15
to Ádám Gmoser, shinyap...@googlegroups.com
Okay, can you send me:

system("systeminfo /FO csv", intern=TRUE, wait=TRUE)

I think something is wrong with that command not working.

In the mean time, you can override the locale detection code by doing by doing:

options(shinyapps.locale='hu_HU')

for Hungarian locales.

Ádám Gmoser

unread,
May 11, 2015, 2:49:44 PM5/11/15
to shinyap...@googlegroups.com, adamg...@gmail.com
The output for system("systeminfo /FO csv", intern=TRUE, wait=TRUE)

[1] "\"Host Name\",\"OS Name\",\"OS Version\",\"OS Manufacturer\",\"OS Configuration\",\"OS Build Type\",\"Registered Owner\",\"Registered Organization\",\"Product ID\",\"Original Install Date\",\"System Boot Time\",\"System Manufacturer\",\"System Model\",\"System Type\",\"Processor(s)\",\"BIOS Version\",\"Windows Directory\",\"System Directory\",\"Boot Device\",\"System Locale\",\"Input Locale\",\"Time Zone\",\"Total Physical Memory\",\"Available Physical Memory\",\"Virtual Memory: Max Size\",\"Virtual Memory: Available\",\"Virtual Memory: In Use\",\"Page File Location(s)\",\"Domain\",\"Logon Server\",\"Hotfix(s)\",\"Network Card(s)\",\"Hyper-V Requirements\""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
[2] "\"ASUS_N551\",\"Microsoft Windows 8.1 Pro\",\"6.3.9600 N/A Build 9600\",\"Microsoft Corporation\",\"Standalone Workstation\",\"Multiprocessor Free\",\"adamg...@gmail.com\",\"\",\"00260-00710-79991-AA282\",\"2014.12.22., 8:37:06\",\"2015.05.07., 22:09:40\",\"ASUSTeK COMPUTER INC.\",\"N551JM\",\"x64-based PC\",\"1 Processor(s) Installed.,[01]: Intel64 Family 6 Model 60 Stepping 3 GenuineIntel ~2501 Mhz\",\"American Megatrends Inc. N551JM.202, 2014.07.17.\",\"C:\\Windows\",\"C:\\Windows\\system32\",\"\\Device\\HarddiskVolume1\",\"hu;magyar\",\"hu;magyar\",\"(UTC+01:00) Budapest, Belgr d, Ljubljana, Pozsony, Pr ga\",\"8˙075 MB\",\"5˙579 MB\",\"16˙267 MB\",\"12˙978 MB\",\"3˙289 MB\",\"C:\\pagefile.sys\",\"WORKGROUP\",\"\\\\ASUS_N551\",\"142 Hotfix(s) Installed.,[01]: KB2899189_Microsoft-Windows-CameraCodec-Package,[02]: KB2843630,[03]: KB2868626,[04]: KB2883200,[05]: KB2887595,[06]: KB2893294,[07]: KB2894856,[08]: KB2900986,[09]: KB2903939,[10]: KB2911106,[11]: KB2912390,[12]: KB2913152,[13]: KB2919355,[14]: KB2919394,[15]: KB2920189,[16]: KB2923528,[17]: KB2928680,[18]: KB2950153,[19]: KB2954879,[20]: KB2955164,[21]: KB2956575,[22]: KB2958262,[23]: KB2959626,[24]: KB2959977,[25]: KB2961072,[26]: KB2961908,[27]: KB2962140,[28]: KB2962409,[29]: KB2964718,[30]: KB2965142,[31]: KB2965500,[32]: KB2967917,[33]: KB2969817,[34]: KB2971203,[35]: KB2971239,[36]: KB2971850,[37]: KB2972280,[38]: KB2973201,[39]: KB2973351,[40]: KB2975061,[41]: KB2975719,[42]: KB2976536,[43]: KB2976627,[44]: KB2976897,[45]: KB2976978,[46]: KB2977292,[47]: KB2977765,[48]: KB2978041,[49]: KB2978126,[50]: KB2978668,[51]: KB2979576,[52]: KB2979582,[53]: KB2980654,[54]: KB2981655,[55]: KB2984006,[56]: KB2988948,[57]: KB2989930,[58]: KB2990967,[59]: KB2992611,[60]: KB2993100,[61]: KB2993651,[62]: KB2993958,[63]: KB2994290,[64]: KB2995004,[65]: KB2995388,[66]: KB2996799,[67]: KB2998174,[68]: KB3000850,[69]: KB3003057,[70]: KB3003667,[71]: KB3003743,[72]: KB3004361,[73]: KB3004365,[74]: KB3004394,[75]: KB3006137,[76]: KB3008242,[77]: KB3008627,[78]: KB3008923,[79]: KB3010788,[80]: KB3011780,[81]: KB3012199,[82]: KB3012235,[83]: KB3012702,[84]: KB3013172,[85]: KB3013410,[86]: KB3013455,[87]: KB3014442,[88]: KB3016074,[89]: KB3018133,[90]: KB3019215,[91]: KB3019868,[92]: KB3019978,[93]: KB3020338,[94]: KB3021674,[95]: KB3021952,[96]: KB3021953,[97]: KB3022777,[98]: KB3022796,[99]: KB3023266,[100]: KB3023562,[101]: KB3023607,[102]: KB3024751,[103]: KB3024755,[104]: KB3025417,[105]: KB3027209,[106]: KB3029606,[107]: KB3029803,[108]: KB3029944,[109]: KB3030377,[110]: KB3030947,[111]: KB3031432,[112]: KB3032323,[113]: KB3032359,[114]: KB3033889,[115]: KB3034196,[116]: KB3034344,[117]: KB3034348,[118]: KB3035017,[119]: KB3035126,[120]: KB3035131,[121]: KB3035132,[122]: KB3035527,[123]: KB3035553,[124]: KB3035583,[125]: KB3036197,[126]: KB3036228,[127]: KB3036562,[128]: KB3036612,[129]: KB3037579,[130]: KB3038314,[131]: KB3039066,[132]: KB3040335,[133]: KB3042085,[134]: KB3042553,[135]: KB3044132,[136]: KB3044374,[137]: KB3045685,[138]: KB3045755,[139]: KB3045999,[140]: KB3046049,[141]: KB3048778,[142]: KB3049508\",\"3 NIC(s) Installed.,[01]: Realtek PCIe GBE Family Controller,      Connection Name: Ethernet,      Status:          Media disconnected,[02]: Qualcomm Atheros AR9485WB-EG Wireless Network Adapter,      Connection Name: Wi-Fi,      DHCP Enabled:    Yes,      DHCP Server:     192.168.0.1,      IP address(es),      [01]: 192.168.0.105,      [02]: fe80::f170:77a6:446e:e21b,[03]: Bluetooth Device (Personal Area Network),      Connection Name: Bluetooth Network Connection,      Status:          Media disconnected\",\"VM Monitor Mode Extensions: Yes,Virtualization Enabled In Firmware: Yes,Second Level Address Translation: Yes,Data Execution Prevention Available: Yes\""

I tried to override the locale, but after I run shinyapps:::detectLocale()I get the same error (unable to detect)

Andy Kipp

unread,
May 11, 2015, 2:56:23 PM5/11/15
to Ádám Gmoser, shinyap...@googlegroups.com
Thanks.

If you've overridden the locale, you dont need to call detectLocale(). You can just run deployApp()

-Andy

Ádám Gmoser

unread,
May 11, 2015, 3:10:02 PM5/11/15
to shinyap...@googlegroups.com, adamg...@gmail.com
Unfortunately there is still the problem with the encoding.
Now I use this to convert my corpus:

textCorpus = tm_map(textCorpus, content_transformer(function(x) iconv(x, to="ISO-8859-2", sub='byte')), mc.cores=1)

Are there any better encoding?

Adam

Andy Kipp

unread,
May 11, 2015, 3:11:26 PM5/11/15
to Ádám Gmoser, shinyap...@googlegroups.com
What is the encoding of the source text? 

Ádám Gmoser

unread,
May 11, 2015, 3:19:16 PM5/11/15
to shinyap...@googlegroups.com, adamg...@gmail.com
The source text encoding is ANSI. Can I try to convert manually to something else?

Andy Kipp

unread,
May 11, 2015, 3:23:11 PM5/11/15
to Ádám Gmoser, shinyap...@googlegroups.com
I would make sure the source data is encoded as UTF-8 rather then attempting to convert it. If you are using RStudio, you can go to File -> Save with Encoding.

Ádám Gmoser

unread,
May 11, 2015, 3:40:11 PM5/11/15
to shinyap...@googlegroups.com, adamg...@gmail.com
I save the source code to utf-8 encoding.
If I miss the textCorpus = tm_map(textCorpus, content_transformer(function(x) iconv(x, to="ISO-8859-2", sub='byte')), mc.cores=1) command, i get this error:
Error: no applicable method for 'meta' applied to an object of class "try-error"

I modified the source text to utf-8 encoding.

Any idea?
Thanks

Andy Kipp

unread,
May 11, 2015, 4:35:04 PM5/11/15
to Ádám Gmoser, shinyap...@googlegroups.com
What is your application URL? I would like to take a look at your source code and data files if you dont mind.

-Andy

Ádám Gmoser

unread,
May 11, 2015, 4:54:24 PM5/11/15
to shinyap...@googlegroups.com, adamg...@gmail.com
http://adamgmoser.shinyapps.io/wordfreq-app
this is a word cloud and frequency app. now it shows the words, but the special characters are replaced with english alphabet letters.
e.g. in lit_er_balasi.txt: 
  • miért -> miert 
  • már -> mer
  • jön -> jfn 

I found this artice about encodings: http://shiny.rstudio.com/articles/unicode.html
Reply all
Reply to author
Forward
0 new messages