Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"byte index [number] is not a char boundary; it is inside '[string]' ..." #73

Open
jpmckinney opened this issue Mar 21, 2025 · 6 comments

Comments

@jpmckinney
Copy link
Contributor

I occasionally see messages like:

thread 'tokio-runtime-worker' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rust_xlsxwriter-0.79.0/src/xmlwriter.rs:291:20:
byte index 67 is not a char boundary; it is inside '”' (bytes 66..69) of `paquetes_de_bolsas_rojas_plásticas_de_alta_densidad_de_18”_x_24”_1`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Other examples of the middle message:

byte index 19 is not a char boundary; it is inside '½' (bytes 18..20) of `tubos_de_1_½_x_1_½_chapa_16_1`
byte index 39 is not a char boundary; it is inside '’' (bytes 38..41) of `manguera_traslucida_de_colores_½_x_75’_1`
byte index 16 is not a char boundary; it is inside '°' (bytes 15..17) of `codo_de_2"_x_90°_1`
byte index 23 is not a char boundary; it is inside '´' (bytes 22..24) of `codo_pvc_liso_1/2_x_90´_1`
byte index 29 is not a char boundary; it is inside '´' (bytes 28..30) of `tuberia_conduit_emt_3/4_x_10´ul__05501ul_1`
byte index 15 is not a char boundary; it is inside '°' (bytes 14..16) of `codo_1/2"_x_90°_1`
byte index 264 is not a char boundary; it is inside '¼' (bytes 263..265) of `sistema_de_sonido_portátil:_______________________________________________________sistema_de_sonido_portátil_de_300_watts_de_potencia,_2_parlantes_y_una_mezcladora:
-_sistema_de_altavoces_de_dos_vías_con_woofer_de_10_pulgadas.
-_7_canales
-_6_combinaci`[...]
@jpmckinney jpmckinney changed the title "byte index [number] is not a char boundary; it is inside '[string]' "byte index [number] is not a char boundary; it is inside '[string]' ..." Mar 21, 2025
@kindly
Copy link
Owner

kindly commented Mar 23, 2025

Do you have an example JSON file I could use where this happened. I suspect it's due to new rust xlsx writer having unicode issues but it's hard to tell from the above.

@kindly
Copy link
Owner

kindly commented Mar 24, 2025

@jpmckinney This is an issue in the xlsxwriter library. Have submitted pull request jmcnamara/rust_xlsxwriter#142 to fix it.

@jpmckinney
Copy link
Contributor Author

Awesome, thank you!

@kindly
Copy link
Owner

kindly commented Mar 27, 2025

@jpmckinney The latest release has the fixed version of rust_xlsxwriter so these issues should be fixed.

@jmcnamara
Copy link

This was fixed in rust_xlsxwriter v0.84.2 but I would recommend upgrading to v0.85.0 which has come out in the meantime.

@kindly
Copy link
Owner

kindly commented Mar 28, 2025

@jmcnamara thanks. I will use the new tmpdir feature too when I upgrade as it makes more sense in this library to set the tmp directory to the same place the xlsx is written.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants