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

Game doesn't start with special characters in save path #414

Closed
krzys-h opened this issue Dec 11, 2014 · 4 comments
Closed

Game doesn't start with special characters in save path #414

krzys-h opened this issue Dec 11, 2014 · 4 comments
Labels
Milestone

Comments

@krzys-h
Copy link
Member

@krzys-h krzys-h commented Dec 11, 2014

[INFO]: Colobot starting
[INFO]: Creating CApplication
[INFO]: Data path: ./data
[INFO]: Save path: C:\Users\Łukasz\colobot
[ERROR]: Error while setting save location to "C:\Users\Łukasz\colobot"
[ERROR]: Error while mounting "C:\Users\Łukasz\colobot"
[ERROR]: Error on parsing profile: failed to open file
[WARN]: Config not found. Default values will be used!
[INFO]: Error on parsing profile: No such node (Language.Lang)
[INFO]: Opening audio device...
[INFO]: Done.
[INFO]: CApplication created successfully
[INFO]: Error on parsing profile: No such node (Setup.Resolution)
[INFO]: Error on parsing profile: No such node (Setup.Fullscreen)
[INFO]: Creating CDevice
[INFO]: Auto-detecting VBO support
[INFO]: OpenGL 4.3, VBO supported
[INFO]: CDevice created successfully
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid
@dexter3k
Copy link

@dexter3k dexter3k commented Dec 18, 2014

Game does start under linux with save path: "~/Łsaves/"
With only one error:
[INFO]: Error on parsing profile: No such node (Setup.Resolution)
OpenGL 2.1 Ubuntu 14.04.1 LTS

@krzys-h
Copy link
Member Author

@krzys-h krzys-h commented Dec 18, 2014

It works correctly for me on Linux too

krzys_h@krzysh-laptop:~/Pulpit/colobot/build$ ./colobot -savedir ./saves_Ł
[INFO]: Colobot: Gold Edition 0.1.4+alpha-git-dev~rfb07691 starting
[INFO]: Using save dir: './saves_Ł'
[INFO]: Creating CApplication
[INFO]: Data path: /usr/local/share/games/colobot
[INFO]: Save path: ./saves_Ł
[ERROR]: Error on parsing profile: failed to open file
[WARN]: Config not found. Default values will be used!
[INFO]: Error on parsing profile: No such node (Language.Lang)

No errors about setting save path or mounting it.

I've also tried to add more Polish characters, but it still works correctly:
[INFO]: Save path: ./saves_ąęśćżń

I'll test that on Windows later.

@dexter3k
Copy link

@dexter3k dexter3k commented Dec 19, 2014

The windows file system uses UTF-16 for such characters. To edit a file with polish name, convert your UTF-8 string to UTF-16, then create it with the UTF-16 name. Maybe you can do it using "codecvt_utf8_utf16".
Sorry, cant test it myself because i have no Windows at home
UPD:
I also saw same problem before, on Jedi Academy sources...
link - https://github.com/mrwonko/Jedi-Academy--Renaissance/blob/master/code/jarlib/src/jar/core/FileSystem.cpp

@krzys-h
Copy link
Member Author

@krzys-h krzys-h commented Mar 21, 2015

Looks like the -savedir argument is encoded as Windows-1250

krzys-h added a commit that referenced this issue Mar 22, 2015
krzys-h added a commit that referenced this issue Mar 22, 2015
@krzys-h krzys-h closed this Mar 22, 2015
krzys-h added a commit that referenced this issue Mar 22, 2015
krzys-h added a commit that referenced this issue Mar 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants