![]() |
#21 |
Adept
Join Date: Aug 2018
Location: Barcelona
Posts: 110
![]() |
Notepad normally uses ANSI encoding, so if it reads the file as UTF-8 then it has to guess the encoding based on the data in the file. If you save a file as UTF-8, Notepad will put the BOM (byte order mark) EF BB BF at the beginning of the file. Notepad makes an educated guess i think.
|
![]() |
![]() |
![]() |
#22 |
Prophet
Join Date: May 2012
Location: Adelaide, Australia
Posts: 2,617
![]() |
Nice, glad someone who knows more about these things got there first.
In preferences, new document, encoding. the default is UTF-8 with a little tick box "Apply to open ANSI files" defaulting to on. Presumably if you hit save as it will save it in UTF-8. |
![]() |
![]() |
![]() |
#23 |
Swordsman
Join Date: Jun 2011
Location: Germany
Age: 54
Posts: 429
![]() |
some more information for users with windows operating systems
Some more details eventually interesting for window users:
An unzipped Angband text file in /lib/gamedata (version 4.1.3) has a disc size of 4096 or a multiple, so the operating system used to create the zip file most likely uses a block write / read disc driver functionality (because it is much faster than reading/writing single chars). Example: p_race.txt has a size of 4621 bytes, and a disc size of 8192 bytes The text files have no Byte order Mark, they are encoded in the ANSI text format. So if you want to modify them, make sure you save with ANSI encoding. Wordpad: does that automatically Editor: you can choose the type (ANSI / unicode / UTF-8) if you Save as Notepad++: requires to be set to ANSI (even if you open an ANSI file with notepad ++ the predefined save option is UTF-8 encoding) The Editor has some kind of problems saving monster.txt in ANSI encoding, afterwards Angband comes up with an parse error. The size of the file changed, but i didn't bother to analyze what exactly changed. Also noteable ... the original files use Hex '0A' (decimal 10) as Newline character. So opening with an Editor that does not add a '0D' carriage return to it (for example the simple Editor) will render the file almost unreadable, because the number of chars per line is 1024 in that case. Notepad++ can handle this format and shows readable lines. And even if you save it in ANSI format, there are still only 0As as end of line characters. Wordpad does add an hex '0D' character at the end of each line. In the case of p_race.txt the file size increases to 4879 bytes. Angband application can parse both 0A alone as well as 0D 0A. Conclusion: Best editor of those 3 for me is notepad++, does not change file size by addind 0D chars, has line numbers and you can choose which encoding to use if you save the file. The only drawback, it always uses UTF-8 as predefined encoding, even if you open an ANSI encoded file.
__________________
Blondes are more fun! |
![]() |
![]() |
![]() |
Tags |
error, modding, modifying |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Modifying Artifacts - Parse error? | philly1919d | Vanilla | 9 | November 23, 2017 09:36 |
Reusing the Angband parser | Byrhtnoth | Development | 12 | March 17, 2017 05:43 |
Error in monsters description | TJS | Development | 4 | July 31, 2010 13:00 |
Lua "obsolete file error", blargh | Therem Harth | ToME | 4 | July 4, 2010 14:02 |
File Dump Error | Batanu44 | Vanilla | 2 | October 13, 2009 00:01 |