rundel / livecode

GNU General Public License v3.0
118 stars 10 forks source link

Error in tolower(iface): invalid multibyte string 1 #10

Closed 4Urban closed 4 years ago

4Urban commented 4 years ago

Hello, thank you for your awesome code in advance!

I tried to run server <- livecode::server_file().

However, I got Error in tolower(iface): invalid multibyte string 1.

What should I do?

rundel commented 4 years ago

That is an odd place for the code to fail, and I'm not entirely sure what might cause that specific error.

Can you run the following code and copy and paste the result:

(ips = livecode:::get_ipv4())
livecode:::ip_type(ips)
livecode:::iface_type(names(ips))

You can anonymize your ip addresses before posting, I'd just like to see the structure of the ips object. Some something like the following would be fine:

(ips = livecode:::get_ipv4())
#            lo0        feth4323             en0 
#    "w.x.y.z"  "w.x.y.z" "w.x.y.z" 
4Urban commented 4 years ago

For your information, I'm using RStudio Windows 64bit version.

> (ips = livecode:::get_ipv4())
    \\<ec> \001<ed> 臍* 1 (Microsoft Wi-Fi Direct Virtual Adapter) 
                                                  "w.x.y.z"
\\<ec> \001<ed> 臍* 11 (Microsoft Wi-Fi Direct Virtual Adapter #2) 
                                                 "w.x.y.z" 
                       Wi-Fi (Intel(R) Dual Band Wireless-AC 8265) 
                                                     "w.x.y.z" 
      Bluetooth $맸l 臍 (Bluetooth Device (Personal Area Network)) 
                                                 "w.x.y.z" 
       Loopback Pseudo-Interface 1 (Software Loopback Interface 1) 
                                                       "w.x.y.z" 
> livecode:::ip_type(ips)
[1] reserved reserved private  reserved loopback
Levels: public private reserved loopback
> livecode:::iface_type(names(ips))
Error in tolower(iface): invalid multibyte string 1
rundel commented 4 years ago

Ah ok, it looks like a unicode issue - it should be possible to fix quickly

rundel commented 4 years ago

Can you see if this version fixes the issue? You can install it with

remotes::install_github("rundel/livecode@unicode_iface")

it would also be helpful if you could paste the result of

livecode::network_interfaces()
4Urban commented 4 years ago

Sadly, I got another error message package ‘stringi’ does not have a namespace. Same with both scripts.

Through the googling, I could solve the problem by install.packages("stringi",type="win.binary"). (Reference: Stackoverflow)

Finally, I can get an address of my sharing!

Thank you for your kindness :)

kolorado commented 9 months ago

I have the same issue, except it's multibyte string 4. I don't seem to have any non ascii characters:

>(ips = livecode:::get_ipv4())
                  Helyi kapcsolat* 1 (Microsoft Wi-Fi Direct Virtual Adapter) 
                                                             "w.x.y.z" 
               Helyi kapcsolat* 2 (Microsoft Wi-Fi Direct Virtual Adapter #2) 
                                                              "w.x.y.z" 
                                            Wi-Fi (Intel(R) Wireless-AC 9560) 
                                                               "w.x.y.z" 
Bluetooth h\xe1l\xf3zati kapcsolat (Bluetooth Device (Personal Area Network)) 
                                                             "w.x.y.z" 
                  Loopback Pseudo-Interface 1 (Software Loopback Interface 1) 
                                                                  "127.0.0.1" 
> livecode:::ip_type(ips)
[1] reserved reserved private  reserved loopback
Levels: public private reserved loopback
> livecode:::iface_type(names(ips))
Error in tolower(iface) : invalid multibyte string 4