|
Post by federico on Aug 26, 2020 14:01:36 GMT
Hi all,
we are experiencing an error using RMS7.2: when we use some accented characters (like à) in our ruby strings, in .erb files of our app, the android build failed with the following error message
"invalid multibyte char (UTF-8)"
How can we set the encoding UTF-8 for our app?
We tried to put the header in the ruby part of .erb file, like
# encoding: UTF-8
but without any result.
We had the same problem also in previous Tau's version of Rhomobile.
Do you have any idea to help us?
Thank you
|
|
|
Post by Alex Epifanov on Aug 26, 2020 15:45:12 GMT
Hi Federico,
We'll check for the possible issue. Do you have a sample app or ruby file?
|
|
|
Post by federico on Aug 27, 2020 9:33:03 GMT
Here you are a sample .erb file (index.erb) attached, and also an image showing the path where you can save it on the RhoMobile app created by RMS wizard. I attach also the console message with the error. Thank you for your attention Federico Error console log.txt (1.07 KB) index.erb (350 B)
|
|
|
Post by Alex Epifanov on Aug 27, 2020 15:31:15 GMT
Federico, you have indeed an invalid UTF8 char code in index.erb, see the hex code E0 is wrong hex code for UTF8. I'm not sure how that did happen ( maybe that's something with Eclipse - it's far not the latest version in RMS). I copy-pasted the letter à from your post and it worked fine, but I did it with command line and VS code. the correct code seems to be C3 A0. I suppose your editor doesn't work well with multibyte UTF.
|
|
|
Post by Alex Epifanov on Aug 28, 2020 14:14:05 GMT
|
|
|
Post by federico on Sept 1, 2020 9:14:28 GMT
Hi Alex, we use only RMS7.2 as editor for our code. As you suggested, we tried to replace the hex code E0 22 with C3 A0 (this time using notepad++ and Hex plugin) but we obtained the result that you can see in the attached screenshot: the capital A with tilde. Also, trying to build with C3 A0 hex code, we get the same error message. Searching the web, we found that C3 = A with tilde and E0 = small accented a is in ISO-8859-1 encoding (see this table as example: cs.stanford.edu/people/miles/iso8859.html)In Notepad++ the default encoding is UTF-8. In RhoStudio (Eclipse) preferences we set the encoding UTF-8 and we did some tests but nothing changed... We are a bit confused about this problem Thank you for your attention and help
|
|
|
Post by Alex Epifanov on Sept 1, 2020 11:42:40 GMT
As a workaround you may try to use another editor. As I said, I use VS Code and have no problems with that. You'll need to use command line instead of GUI to build and run the app though, but that's pretty straightforward.
|
|
|
Post by federico on Sept 3, 2020 8:07:53 GMT
Hi Alex,
following your suggestion, we tried to use VS Code as editor and we fixed the wrong char code.
Also, it seems that setting the encoding UTF-8 for RMS Eclipse solved the problem
and now we can build for android with accented letters.
We set UTF-8 for Eclipse this way:
1) Window > Preferences > General > Content Types, set UTF-8 as the default encoding for all .erb files.
2) Window > Preferences > General > Workspace, set Text file encoding to Other : UTF-8
Thank you so much for your help!
|
|