"ç" and the size of the script (never use a "ç")

V3DigitimesV3Digitimes Posts: 3,150

Hello,

I have an issue with one of my script. I'm using "AppSettings.setStringValue( "path" , FileInf.path() );" in one of my scripts in order to remember some useful path for the user.

This command is in a function launched by widgets.

The issue I have now is that as soon as save my file, the size of the dsa gets bigger and bigger. Now after a few save is is too big to be opened by anything (131 Mo). Yet the number of lines has not changed (around 4500). I don't understand what is happening?

Does anybody have an idea what is happening?

Edit : finally it did not comme from AppSettings, but from a "ç" which was in one of my comments and lead to a huge mess. I'll remember not to use special characters now!

 

Post edited by V3Digitimes on

Comments

  • mjc1016mjc1016 Posts: 15,001

    Which OS...because there's probably a version of Vim that would open it (no real file size limit).  Without being able to actually look at the file it's hard to say what is being included, that shouldn't be.

  • V3DigitimesV3Digitimes Posts: 3,150

    I'm on PC.

    I don't understand, I removed all "AppSettings" from my script and still have the issue. I must have done something wrong. Even when I removed all "AppSettings" from everywhere, each time I save the script, EVEN if I don't modify it, the size doubles (or almost double). I start at 400 ko, and just save, save, save doing nothing else, I end up at 131 Mo. I am currently trying to revert to a script which does not present this issue. 

  • mjc1016mjc1016 Posts: 15,001

    You really do need to get one of those inflated saves opened to see what's being added...

    You re saving them through the script editor and not some external editor, right?

  • V3DigitimesV3Digitimes Posts: 3,150

    Yes I save them with the script editor.

    I wonder if there is an editor which could allow them to "remember" that they are small. NotePad++ does not do the trick.

    I'm still reverting to previous versions see what I have done wrong. Something I made around noon obviously.

  • SimonJMSimonJM Posts: 5,982

    I've not used the script editor in ages, so not sure if this is feasible.  Could you open the script in the editor, select all, copy, then paste into a basic text editor (notepad, or notepad++, etc.).  That should give you just the code and no extraneous junk.  if so, then delete/rename the original and start again by copying the clean text back in, after doing a select all, copy from with your text editor.

  • V3DigitimesV3Digitimes Posts: 3,150
    edited May 2016

    Thanks I'm gonna try this. Oh Gosh I copied in word and I think I have a "special" character in my script!

    I copied paste "text without form" in word (YES I DID, YES IN WORD 2000 MUHAHAHAHA) and I have more 28000 pages of "Â". I saw it is linked to the use of a "ç " in of my comments... I would be cool if this was the issue.

    So this was not linked to the AppSettings ! I'm gonna change the title of the thread. It seems to be solved... Thanks to word... (If I was told word would save my scripts I would have never believed it).

    Post edited by V3Digitimes on
  • SimonJMSimonJM Posts: 5,982

    Good to hear it's sorted! :)

  • V3DigitimesV3Digitimes Posts: 3,150

    Thank you Simon! I was going totally crazy. Notepad ++ did not see the "ç" as an issue (well it crashed). But word.. What a software this old good word 2000!!!!

  • Richard HaseltineRichard Haseltine Posts: 100,927

    What format were you saving to - ASCII or compressed?

  • V3DigitimesV3Digitimes Posts: 3,150

     

     

    What format were you saving to - ASCII or compressed?

    well... I was doing : File/Save Script As/Daz Script 2 plain text (*.dsa).

    Would it have changed something?

  • Richard HaseltineRichard Haseltine Posts: 100,927
    edited May 2016

    No, but if it was compressed that would ahve been two possible points of failure.

    It seems unblikely to be the issue, but had you typed your commands or had you copied-and-pasted from the scripting docs at all?

    Post edited by Richard Haseltine on
  • V3DigitimesV3Digitimes Posts: 3,150
    edited May 2016

    I had typed my commands. I copy paste less and less now.

    The issue is that at one stage, I wrote in the comment "//ça doit être 4.9.2.23".

    And the //ç transformed to plenty of "A" and the most I save, the most I have. I can replicate the issue.

    I have just tested on a file where I have just written "//ça doit être 4.9.2.23" . The first "saves as" it does not goes to big. But after a while it's like a 2 to the power n... The size explodes. Just with a script having as a comment "//ça doit être" and nothing else in the script.

    edit at the begining it gives "//ça doit être 4.9.2.23"

    so it's not only the "ç" it's also the "ê". but it never stops growing. If you take the file I join, open in script ide and save as a new file several times, then you can manage to crash Daz, and any other editor of your choice (well except my old good word 2000 which supports 268000 pages of Â‚à ).

     

    zip
    zip
    GettingBiggerAndBigger (2).zip
    1K
    Post edited by V3Digitimes on
  • mjc1016mjc1016 Posts: 15,001

    It isn't exploding for me...

    A couple possible things I can think of...language settings/character encoding could be messing things up.  If it's trying to 'translate' a character that isn't supported in the encoding/language being used.

    I'm running in WINE on Linux with full UTF-8 support enabled, so all the characters are probably correctly handled. 

  • V3DigitimesV3Digitimes Posts: 3,150

    I'm on Script IDE on PC... It does not explode on notepad ++ for me. It does not change size. It's on script IDE that the size doubles each time, DS 4.8 and DS 4.9.

    Does it explode if you save as / save as / save as (use a new name to be sure) but in script IDE?

    PS : I may not have your answer right now, I'm going to bed :)

     

  • mjc1016mjc1016 Posts: 15,001

    Just saved it about 15 times through the Script IDE...both over top of the old file (Save) and with a new name (Save As)....

  • V3DigitimesV3Digitimes Posts: 3,150

    So you think it comes from the fact that I don't have a full UTF-8 support, and since the characters are not recognised, then they are replaced by longer chains of characters each time?

  • mjc1016mjc1016 Posts: 15,001

    That's one possiblity...another is that there's a bug in the language pack for the version of Windows you are running.  I think it's more likely a character encoding issue, though. 

    Are you using French or English as the 'native' language on Windows?

     

  • V3DigitimesV3Digitimes Posts: 3,150
    edited May 2016
    mjc1016 said:

    That's one possiblity...another is that there's a bug in the language pack for the version of Windows you are running.  I think it's more likely a character encoding issue, though. 

    Are you using French or English as the 'native' language on Windows?

     

    I'm using windows 7 pro French. I could test on my windows 10 french laptop, but I lack of time right now. Anyway, I'll remember that I have to keep on writting my comments in english!

    Post edited by V3Digitimes on
  • mjc1016mjc1016 Posts: 15,001

    It's the French characters messing it up...the exact 'how' and 'why' I'm not sure about.  There have been a couple of other strange things that have shown up that could be character encoding issues, too, but they are not very common and are very difficult to reproduce. 

  • V3DigitimesV3Digitimes Posts: 3,150
    mjc1016 said:

    It's the French characters messing it up...the exact 'how' and 'why' I'm not sure about.  There have been a couple of other strange things that have shown up that could be character encoding issues, too, but they are not very common and are very difficult to reproduce. 

    Ok thanks for the information. Usually I write all my comments in english, but this time, I don't know why, maybe too tired, or too excited, or too much something else, the comment was written in French! And I promised to myself it would be the last time!

Sign In or Register to comment.