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 25 Nov 2008, 16:16
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: 6115
Location: Poland
MHajduk 25 Nov 2008, 16:54
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 25 Nov 2008, 17:22
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: 6115
Location: Poland
MHajduk 25 Nov 2008, 17:26
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: 4024
Location: vpcmpistri
bitRAKE 26 Nov 2008, 02:23
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: 455 Time(s)


_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup


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: 4024
Location: vpcmpistri
bitRAKE 26 Nov 2008, 02:31
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: 6115
Location: Poland
MHajduk 26 Nov 2008, 09:09
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 27 Nov 2008, 19:59
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: 4024
Location: vpcmpistri
bitRAKE 27 Nov 2008, 20:39
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 27 Nov 2008, 21:35
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: 12740
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 27 Nov 2008, 21:54
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 27 Nov 2008, 22:05
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: 3175
Location: Denmark
f0dder 28 Nov 2008, 06:31
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: 4024
Location: vpcmpistri
bitRAKE 28 Nov 2008, 06:41
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: 3175
Location: Denmark
f0dder 28 Nov 2008, 06:52
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: 4024
Location: vpcmpistri
bitRAKE 28 Nov 2008, 08:07
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: 20301
Location: In your JS exploiting you and your system
revolution 28 Nov 2008, 09:00
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: 1614
Location: Ukraine
shoorick 28 Nov 2008, 09:58
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: 4624
Location: Argentina
LocoDelAssembly 28 Nov 2008, 14:35
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: 20301
Location: In your JS exploiting you and your system
revolution 28 Nov 2008, 15:17
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.