If you're saving and loading files in a format that works or fails based on the regional settings of the computer you're on, you're doing it wrong. We call load/save routines which do this 'broken' or 'buggy'.
There are well established methods of handling file save and load which don't have any portability or regional concerns; printing to ascii-7 using standard printf in POSIX mode is one possible way, printing to ascii-7 for tags and numerical data and utf-8 for unicode strings is another. Binary formats can even be used, so long as you're strict about byte order specification, but I would recommend against it given the expected usage case. Dennis Towne On Fri, Sep 25, 2015 at 9:00 AM, <[email protected]> wrote: > I'm going to take a guess and answer this question in a way that might not be > what you meant at all. > Save files for a game might work fine for some people, but be considered > corrupted by the game when being opened by other people. Regional settings > tend to separate the people who will have no trouble, and the people who > can't open their saved game files. The reason is that different parts of the > world store numbers differently. If a game designer forgets to account for > those changes, in each and every part of their game, they'll cause errors. > As an example, lets say you are playing a game and you tell it to save. In > this game the file will record how many mice your warrior has heroically > killed in battle, and also how much health he has left. The first number is > an integer, since you can't normally kill 2.25 mice. That first number will > work for anyone, no matter where in the world they live. The second number > is your health, and lets assume your warrior has 95.4 health points. That > decimal is where things will go wrong. In some parts of the world a comma is > used instead of that decimal point, so the file will store that value as > 95,4. When the game goes to load your save file, it encounters 95,4 when it > is expecting a number. Well in that part of the world 95,4 is a perfectly > valid number, but the game was built in a place where a comma doesn't mean > the same thing as a decimal point. So the game has a little melt down > because computers don't like surprises. > Once again, this might not have been what you meant when you asked this > question, so sorry in advance if I guessed wrong. :) > - Aprone > From: Leo Cantos <[email protected]> > To: [email protected] > Sent: Friday, September 25, 2015 11:49 AM > Subject: [Audyssey] Save files and different regions > > I would like to ask a question: how do save files have to do with > regional settings? > > > > I could see how they would work with time and all however it seems that it > would only occur if the computer was turned off unexpectedly, then the save > file would not save, but I don't know. > > > > I figured I would ask as I am interested. > > > > Leo > > > --- > Gamers mailing list __ [email protected] > If you want to leave the list, send E-mail to [email protected]. > You can make changes or update your subscription via the web, at > http://audyssey.org/mailman/listinfo/gamers_audyssey.org. > All messages are archived and can be searched and read at > http://www.mail-archive.com/[email protected]. > If you have any questions or concerns regarding the management of the list, > please send E-mail to [email protected]. --- Gamers mailing list __ [email protected] If you want to leave the list, send E-mail to [email protected]. You can make changes or update your subscription via the web, at http://audyssey.org/mailman/listinfo/gamers_audyssey.org. All messages are archived and can be searched and read at http://www.mail-archive.com/[email protected]. If you have any questions or concerns regarding the management of the list, please send E-mail to [email protected].
