Edit: Solution is in Post #3.
Note: This also solved a problem where dashes(-) did not display correctly in WebView even though they displayed fine in a browser.
I have several html files that I need to read in and edit. I am using File.readstring to read them in to a variable then editing. One of them fails but only in B4i
the error is
If I rem the error trapping I get:
After much fooling around I isolated the part of the file where the issue occurs.
This Fails (Again, only in B4i):
This does not:
The file is an MS Word document saved as an html file so there should be no problem loading it.
FYI The difference is actually the loading of a high bit character that looks like the 'Hamburger" icon. That would be the
≡
I can work around the problem but perhaps this is a bug that needs to be looked at?
Note: This also solved a problem where dashes(-) did not display correctly in WebView even though they displayed fine in a browser.
I have several html files that I need to read in and edit. I am using File.readstring to read them in to a variable then editing. One of them fails but only in B4i
the error is
B4X:
<B4IExceptionWrapper: Error Domain=caught_exception Code=0 "Error reading file. Incorrect encoding" UserInfo={NSLocalizedDescription=Error reading file. Incorrect encoding}>
B4X:
Error occurred on line: 71 (PageHelp)
Error reading file. Incorrect encoding
Stack Trace: (
CoreFoundation <redacted> + 252
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation <redacted> + 0
ALA Phone -[B4IFile ReadString2:::] + 468
ALA Phone -[B4IFile ReadString::] + 120
CoreFoundation <redacted> + 144
CoreFoundation <redacted> + 292
ALA Phone +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
ALA Phone -[B4IShell runMethod:] + 448
ALA Phone -[B4IShell raiseEventImpl:method:args::] + 1648
ALA Phone -[B4IShellBI raiseEvent:event:params:] + 1580
ALA Phone __33-[B4I raiseUIEvent:event:params:]_block_invoke + 60
libdispatch.dylib <redacted> + 24
libdispatch.dylib <redacted> + 16
libdispatch.dylib <redacted> + 1068
CoreFoundation <redacted> + 12
CoreFoundation <redacted> + 1924
CoreFoundation CFRunLoopRunSpecific + 436
GraphicsServices GSEventRunModal + 104
UIKitCore UIApplicationMain + 212
ALA Phone main + 128
libdyld.dylib <redacted> + 4
)
After much fooling around I isolated the part of the file where the issue occurs.
This Fails (Again, only in B4i):
B4X:
<p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;
text-align:center;line-height:normal;text-autospace:none'><span lang=EN-CA
style='font-size:14.0pt'>The menu is accessed by pressing the 'Hamburger' (</span><span
style='font-size:13.0pt;font-family:"Arial","sans-serif"'>≡</span><span
lang=EN-CA style='font-size:14.0pt'>) icon in the upper left.</span></p>
B4X:
<p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;
text-align:center;line-height:normal;text-autospace:none'><span lang=EN-CA
style='font-size:14.0pt;mso-ansi-language:EN-CA'>The menu is accessed by
pressing the 'Hamburger' () icon in the upper left.</span></p>
FYI The difference is actually the loading of a high bit character that looks like the 'Hamburger" icon. That would be the
≡
I can work around the problem but perhaps this is a bug that needs to be looked at?
Last edited: