stringfish icon indicating copy to clipboard operation
stringfish copied to clipboard

Error in qdeserialize(x) : Endian of system doesn't match file endian

Open barracuda156 opened this issue 2 years ago • 0 comments


R version 4.2.3 (2023-03-15) -- "Shortstop Beagle"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: powerpc-apple-darwin10.8.0 (32-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> suppressMessages(library(stringfish, quietly = T))
> suppressMessages(library(qs, quietly = T))
> suppressMessages(library(dplyr, quietly = T))
> suppressMessages(library(Rcpp, quietly = T))
> suppressMessages(library(stringr, quietly = T))
> suppressMessages(library(rlang, quietly = T))
> 
> encode_source <- function(file, width = 160) {
+   n <- file.info(file)$size
+   x <- readChar(con = file, nchars=n, useBytes = T)
+   x <- qserialize(x, preset = "custom", algorithm = "zstd", compress_level = 22)
+   x <- base91_encode(x)
+   starts <- seq(1,nchar(x), by=width)
+   x <- sapply(starts, function(i) {
+     substr(x, i, i+width-1)
+   })
+   x <- gsub('\\"', "\'", x)
+   dput(x)
+ }
> 
> decode_source <- function(x) {
+   x <- paste0(x, collapse = "")
+   x <- gsub("\\'", '\\"', x)
+   x <- base91_decode(x)
+   qdeserialize(x)
+ }
> 
> altrep_support <- function() {
+   getRversion() >= "3.5"
+ }
> 
> is_solaris <- function() {
+   grepl('SunOS',Sys.info()['sysname'])
+ }
> 
> myfile <- tempfile()
> print(myfile)
[1] "/opt/local/var/macports/build/_opt_PPCRosettaPorts_R_R-stringfish/R-stringfish/work/.tmp/RtmpclsbaR/fileac0247022275"
> 
> # i500_utf8 <- readRDS("/tmp/temp.rds")
> # i500_latin1 <- iconv(i500_utf8, "UTF-8", "latin1")
> 
> # For a test set, we are using the 500 most common Icelandic words
> # This is a pretty good test set because all Icelandic words can be encoded as either UTF-8 or latin1. It also contains a mix of ASCII and non-ASCII strings
> # https://www.101languages.net/french/most-common-french-words/
> # https://en.wikipedia.org/wiki/ISO/IEC_8859-1
> # qserialize(x[1:500], preset = "custom", compress_level = 22, check_hash=F) %>% base91_encode %>% catquo
> i500_utf8 <- decode_source('un]"BAAA@QBtHACAAAAAAAY4TBAABdk1kure+B3AwoFYdc"lM?hVjfxq5F^5OXd&}iic*u6aS*TsW0{Ur6@MdueBh+g1us}b/1]FhtGOG"/1xj=x/iL}2,4f#H8v+r_qDxuL3U2jD!9.@z%wUvNyLRYr4SugnxE`=hw2L+NI<X8w<q*MV&?(?V:FE!?+CimfUy<&u/Bk7xer7/u;syo9Cu:qx7J57?*_/6I@)xs[J;fXOK0B_l"[4EKyF#:{7z_>g.MhpqTM[&1_P.E@i&,j(3{?d|qu!g,fl:gUcJ;U#KwdN,_?zyzU~K@dwS}Evq&qWYNl(?xqk$j/L#s#{3^H)BXxo`t["IA+j+JLI*yEkS0<p4a3PV6<~N!f3v7HyE$j@/I@W0d[sy)p&z)?(k>qJoTLq#eE)}t8G:F`@bQJHYvHND{eS"@QH)m6Rgv,|a)@nV=!*%=<jElUsK5k}4,axCwZ~NB(+e|XA1OKDJ^@koTm4YAx#I8oCQOq}fyfqL>?loMXRva2k*4.V&`n?1j~MzQ1J[9t?IH1jV})PLT^,GA0J#8|VB=n9=cy91B.#J$m{SgJ=mk(5x*ml:j%u.(+_Nk8#/@w]C~PyEVk+tlU.iicD2hk^dYc2am&[email protected]$lbUZcTidf.IoKPnSUJp!gab|bS61!4U_u&XTPnEo%eUP&0J.OisuVyZ:|}b|Nl1[pZ:.7wOOS+*I`ojDvw6E#rq"){8i7Pt{.auL+`GVyZ&w!NKtp3k09J+K?;<:}#O/9+N#5DYF<{|cy7P_*9GzY(f4<qR$a&EaGeQ.fIo7_o#X?"_M$d[S]3;vJzM8Eg!;x(]~Nzn<d9`rCeJwn"5zd(npX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Czd47&afxl]96H/Z?[i&YvmbxiMJeCG^Aaa|?j%`2*,@i#1#W!xfvG@/h+Fi{oGa;|c51I8C8wd:HDBosoF)n$IHioJa`RX.b{/KMM{y~N>}w]SjR<!KXER}h`e]WqHRV23+V;}SIx=N<#*xddZ;%wo?L|HnnOppxwc_[Lh.DG+`X4Nc1v{4;0]5$ufCd$vk}b+eLW,PsPc8E$GKSG$R:VznhU$t,kTg+?f"Z<R~:M=B9igR+DVzULgg8$!2^~T"RcU9:ln<8Jd4i$50@^s1{R9lVwJ^Pll*t>TN!=Lee,!77)G){k&p"C)_}`H&B|^B')
Error in qdeserialize(x) : Endian of system doesn't match file endian
Calls: decode_source -> qdeserialize
Execution halted

Same error as here: https://github.com/traversc/qs/issues/77

barracuda156 avatar Mar 20 '23 20:03 barracuda156