flat assembler
Message board for the users of flat assembler.

Index > Main > Notepad utf-8 format BOM Header

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
skykrnl



Joined: 17 Nov 2008
Posts: 21
skykrnl
Notepad to save utf-8 format for the first time will increase BOM header
Fasm hope to increase this type of documents to read.

记事本在保存为 utf-8 格式的时候会增加 BOM 头,希望 fasm 能够支持对这类utf-8文件的读取
Post 25 Nov 2008, 16:16
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6038
Location: Poland
MHajduk
skykrnl wrote:
Notepad to save utf-8 format for the first time will increase BOM header
Fasm hope to increase this type of documents to read.

记事本在保存为 utf-8 格式的时候会增加 BOM 头,希望 fasm 能够支持对这类utf-8文件的读取
From my private experience I can say that console version of FASM has no problems with compiling sources encoded in UTF-8 with or without BOM.

BTW, don't use FASMW (i.e. original FASM IDE)! Use only console version of FASM! Find any editor with syntax highlighting (for example PSPad or any other) and adapt it for FASM.
Post 25 Nov 2008, 16:54
View user's profile Send private message Visit poster's website Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto
Yes PSPad is great ,i just downloaded yestrday,
but I keep using notepad because PSPad with all the functions that it distracts me Rolling Eyes

_________________
Nil Volentibus Arduum Razz
Post 25 Nov 2008, 17:22
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6038
Location: Poland
MHajduk
DJ Mauretto wrote:
but I keep using notepad because PSPad with all the functions that it distracts me Rolling Eyes
Don't worry, you can forget about most of these functions (I use only few of them). Wink
Post 25 Nov 2008, 17:26
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3056
Location: vpcmipstrm
bitRAKE
Here is my syntax file for PSPad, updated to version 1.67.29 of FASM. Keywords are divided into four groups: instructions, registers, preprocessor, control/other. This makes it very easy to read macros, imho. Please let me know of any errors / ommisions.

PSPad took me some time to configure for FASM. Code Explorer basically does not work with FASM syntax. Yet, by using the "ftPVS" parser it has some use ( for my coding style {label}: ). Also, the "ftPureBasic" works for browsing macros. Code completion would be much work - no desire atm.

First I turned off extra line spacing:
Code:
  menu    Settings\Program Settings...
       button  [Direct Edit]
       item    ExtraLineSpacing=0    

...then I setup a batch file to build with FASM.EXE which doesn't require any changes to sources or environment variables (fasm_build.cmd).
Code:
@ECHO OFF
SET FASMW=F:\FASMW16729
SET PATH=%FASMW%;%PATH%
SET INCLUDE=%FASMW%\INCLUDE
FASM %*    
Highlighters Settings
Code:
    Compiler:   {where you saved it}\fasm_build.cmd
      Parameters: "%File%"

      [X] Save All Files Before Compilation
       [X] Capture Program Output Window
   [X] Hide Output window

  Log window type: [Memo]

     LOG Parser      %F [%L]    


Description: Put in syntax directory of PSPad installation.
Download
Filename: PSPad-Syntax-FASM.7z
Filesize: 2.52 KB
Downloaded: 220 Time(s)


_________________
¯\(°_o)/¯ unlicense.org


Last edited by bitRAKE on 26 Nov 2008, 06:42; edited 4 times in total
Post 26 Nov 2008, 02:23
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3056
Location: vpcmipstrm
bitRAKE
The BOM could be removed with FASM Smile

It is just the first three bytes, iirc.
Code:
; Strip BOM bytes from UTF8 files if present
format binary as "UTF8.fasm"
virtual at 0
  file "BOMtest.fasm":0,4
  load BOM dword from 0
end virtual
if (BOM and $FFFFFF) = $BFBBEF
  file "BOMtest.fasm":3
else if (BOM and $FFFF) = $FEFF
  ; wide character, much more work...
else
  file "BOMtest.fasm"
end if    
...would skip first three bytes.
Post 26 Nov 2008, 02:31
View user's profile Send private message Visit poster's website Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6038
Location: Poland
MHajduk
Good work bitRAKE. Smile
Post 26 Nov 2008, 09:09
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
bitRAKE,

You may also wrap it in a batch file with some environment variables set, just to be generic. And don't forget about non-canonical (should I say not well-formed?) encodings… Wink
Post 27 Nov 2008, 19:59
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3056
Location: vpcmipstrm
bitRAKE
Yeah, I thought about using the "-d" option of FASM to specify the file, and wrapping the whole thing in a batch file. I don't have much experience with Unicode files. "not well-formed": Are you speaking about alternate BOM's for UTF-8, or rather other encodings?
Post 27 Nov 2008, 20:39
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
bitRAKE,

file expands env. vars as well as include does (cf. PREPROCE.INC).

well-formed was about clause in "3.9 Unicode Encoding Forms", The Unicode Standard, Version 5.0. F0 8F BB BF is decoded to FEFF too…
Post 27 Nov 2008, 21:35
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 9189
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
Quote:

Notepad to save utf-8 format for the first time will increase BOM header
Fasm hope to increase this type of documents to read.


isn't correctly translated from

Quote:

记事本在保存为 utf-8 格式的时候会增加 BOM 头,希望 fasm 能够支持对这类utf-8文件的读取


the chinese version said,
when notepad save a file as UTF-8(记事本在保存为 utf-8 格式的时候), it will add a BOM header(会增加 BOM 头).
he hope fasm (希望 fasm 能够) assembler would
support this kinda BOM added asm source file (支持对这类utf-8文件的读取)

human is the best translator Smile
Post 27 Nov 2008, 21:54
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
sleepsleep,

I'd already thought of "increase" being somewhat out of context… Automatic translators, heh? Wink
Post 27 Nov 2008, 22:05
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Keep source in ANSI form, and have international strings external to your source code... much better way of handling things.
Post 28 Nov 2008, 06:31
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3056
Location: vpcmipstrm
bitRAKE
What about comments in the source code?
Post 28 Nov 2008, 06:41
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
bitRAKE wrote:
What about comments in the source code?
IMHO the language of programming is English. This might sound a bit arrogant, but keep in mind that my primary language is Danish.

Non-English might be OK for purely hobby projects, but as soon as you're going to share/publish, English is the best choice, simply because it's the language shared by most people (even if it's smaller than Chinese etc. as primary language).

Yeah, I know, people aren't going to agree.

_________________
Image - carpe noctem
Post 28 Nov 2008, 06:52
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3056
Location: vpcmipstrm
bitRAKE
Effective communication might require an exchange in multiple languages, and I wouldn't want to sacrifice the communication for some least common less potent version. If the automatic translators are any indication, it seems different cultures have adopted their own analogies to assist comprehension of programming ideas. It would be presumptuous of me to force the adoption of my culture, or lessen the impact of another culture on the topic.

So, I guess I'm one of the people that don't agree. (I have a deep respect for anyone taking the time to translate their work into English, but I also have a deep respect for anyone that takes the time to contribute openly -- even if they don't know English.)
Post 28 Nov 2008, 08:07
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17717
Location: In your JS exploiting you and your system
revolution
English is only my second language but I feel that it is the most useful for exchange of ideas inside source files, even internally to myself.
Post 28 Nov 2008, 09:00
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
the global sense of question: adjust human to computer or computer to human
Post 28 Nov 2008, 09:58
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Quote:
English is only my second language

REALLY???
Post 28 Nov 2008, 14:35
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17717
Location: In your JS exploiting you and your system
revolution
LocoDelAssembly wrote:
Quote:
English is only my second language

REALLY???
Sure.
Post 28 Nov 2008, 15:17
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.