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

Can not load vehicles with special characters in authors section #364

Closed
Michael10055 opened this Issue Aug 7, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@Michael10055
Contributor

Michael10055 commented Aug 7, 2015

NothingToDo posted this in the RoR Skype group, I thought I'd post a bug report on it since I found the cause of it.

Using this vehicle: http://www.rigsofrods.com/repository/view/5548
The authors section has a special character in it, causing a runtime error to occur.
author Lampe flèches -1 dolmen62
2015-08-07_08-50-42
RoR.log says the parser ignores the line:

08:50:22:  ===== LOADING VEHICLE: afc4UID-a4e3UIDsprinterasf.truck
08:50:22:  == Parsing vehicle file: afc4UID-a4e3UIDsprinterasf.truck
08:50:22:  == Parsing done, report:

#FF3300 ERROR #FFFFFF (Section globals)
    Line (11): author Lampe flèches -1 dolmen62
    Message: Invalid line, ignoring...
#FFFF00 WARNING #FFFFFF (Section meshwheels)
    Line (673): -36
    Message: Encountered node with illegal negative number: '-36', parsing as positive '36' for backwards compatibility. Please fix as soon as possible.



08:50:22:  == Validating vehicle: Sprinter ASF
08:50:22:  == Validating done OK

Does not happen in 0.4.0.7.

@Max98 Max98 added the bug label Aug 12, 2015

@Max98 Max98 added this to the Post-Nextstable milestone Aug 12, 2015

@Hiradur Hiradur modified the milestones: Post-Nextstable, 0.4.6.0 Oct 24, 2015

@only-a-ptr

This comment has been minimized.

Show comment
Hide comment
@only-a-ptr

only-a-ptr Nov 13, 2015

Member

@hotrod55 Thanks for reporting. I'll look into it.

Member

only-a-ptr commented Nov 13, 2015

@hotrod55 Thanks for reporting. I'll look into it.

@only-a-ptr

This comment has been minimized.

Show comment
Hide comment
@only-a-ptr

only-a-ptr Nov 18, 2015

Member

@hotrod55 The problem is RoR assumes truckfiles saved in UTF-8 encoding. This truck is either in https://en.wikipedia.org/wiki/Windows-1252 or https://en.wikipedia.org/wiki/ISO/IEC_8859-1, I can't tell exactly. I discovered it by saving file to disk, opening it in firefox and then switching [Display->character set->*] options until it matched. The working option was "Western languates" which means one of the above. There is no way to auto-detect it.

I'll figure something out tho.

Member

only-a-ptr commented Nov 18, 2015

@hotrod55 The problem is RoR assumes truckfiles saved in UTF-8 encoding. This truck is either in https://en.wikipedia.org/wiki/Windows-1252 or https://en.wikipedia.org/wiki/ISO/IEC_8859-1, I can't tell exactly. I discovered it by saving file to disk, opening it in firefox and then switching [Display->character set->*] options until it matched. The working option was "Western languates" which means one of the above. There is no way to auto-detect it.

I'll figure something out tho.

@only-a-ptr

This comment has been minimized.

Show comment
Hide comment
@only-a-ptr

only-a-ptr Nov 19, 2015

Member

Reproduced. Fixing in progress....

Member

only-a-ptr commented Nov 19, 2015

Reproduced. Fixing in progress....

only-a-ptr added a commit to only-a-ptr/rigs-of-rods that referenced this issue Jan 31, 2016

[fix] Added full-scale UTF-8 sanitization; no more crashes.
This resolves the inflamous "Bad UTF-8 continuation byte" error dialog. Fixes RigsOfRods#237 RigsOfRods#385 RigsOfRods#664 RigsOfRods#445 RigsOfRods#364

Incorporated UTFCPP library: (utfcpp.sourceforge.net/; License: boost) and added UTF-8 sanitization to all text-file processing.

@InvalidUTF8character: YOU SHALL NOT PASS! :D
@only-a-ptr

This comment has been minimized.

Show comment
Hide comment
@only-a-ptr

only-a-ptr Feb 2, 2016

Member

Fixed in upstream.

Member

only-a-ptr commented Feb 2, 2016

Fixed in upstream.

@only-a-ptr only-a-ptr closed this Feb 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment