UTF-8 (no BOM) format support?
- Author
- Message
-
Offline
- Posts: 9
- Joined: Sat Apr 14, 2012 3:50 pm
UTF-8 (no BOM) format support?
I'm using AkelPad to edit lua script for "LOVE2D" game engine, this engine recognize unicode string in UTF-8 (no BOM) format only, but AkelPad only saved as UTF-8 with BOM format. So my script encounted errors.
Could AkelPad support UTF-8 (no BOM) format?
Could AkelPad support UTF-8 (no BOM) format?
-
Offline
- Posts: 2248
- Joined: Tue Aug 07, 2007 2:03 pm
- Location: Vinnitsa, Ukraine
ZoNi, try to Redetect codepage or set manually. Press F12 while in Akelpad - in poped menu click "Redetect" for automatic redetection. Or on the same menu select submenu "Open As" and select desired(guessed) codepage.
If no other codepage conforms you - that means you really have such content in text file and automatic detection was successful.
If you have managed to find right codepage and such problem persists for other files, then you probably forgot to configure autodetection: goto Options - Settings - Genetal tab - Codepage recognition. You also can play with codepage filter.
If no other codepage conforms you - that means you really have such content in text file and automatic detection was successful.
If you have managed to find right codepage and such problem persists for other files, then you probably forgot to configure autodetection: goto Options - Settings - Genetal tab - Codepage recognition. You also can play with codepage filter.
Last edited by FeyFre on Wed Apr 25, 2012 6:04 pm, edited 1 time in total.
-
Offline
- Posts: 165
- Joined: Fri Aug 15, 2008 8:58 am
When I exit after save and reload file in AkelPad, file return to Ansi instead of remain UTF.KDJ wrote:topsuccess
Main menu -> File -> Save as -> Codepage,
or press hotkey Ctrl+Shift+S,
choose:
65001 (UTF-8)
and unselect:
BOM
Do it is possible to avoid and mantain it UTF without BOM.
In need it for PHP.
-
Offline
- Posts: 165
- Joined: Fri Aug 15, 2008 8:58 am
Re: UTF-8 (no BOM) format support?
Do it is possibile to save to UTF-8 (without BOM) from status bar contextual menu or set it as default?
-
Offline
- Posts: 47
- Joined: Sat Jul 05, 2008 11:30 am
- Location: Odesa, Ukraine
Re: UTF-8 (no BOM) format support?
Diamen
There's a switch to turn on/off BOM/No BOM saving mode.
You can make a button/menu entry of it:
There's a switch to turn on/off BOM/No BOM saving mode.
You can make a button/menu entry of it:
Code: Select all
"No BOM" +Call("SaveFile::SaveNoBOM")
-
Offline
- Posts: 165
- Joined: Fri Aug 15, 2008 8:58 am
Re: UTF-8 (no BOM) format support?
Call work but when I reload the file saved in UTF-8 no BOM Akelpad not recognize it and load as Ansi.
-
Offline
- Posts: 165
- Joined: Fri Aug 15, 2008 8:58 am
Re: UTF-8 (no BOM) format support?
Codepage recognize not work when have few characters in a file.
f.e.:
this is utf-8 ò.
Not problem with notepad.exe with same file.
f.e.:
this is utf-8 ò.
Not problem with notepad.exe with same file.
-
Offline
- Posts: 1292
- Joined: Thu Nov 16, 2006 11:53 am
- Location: Kyiv, Ukraine
Re: UTF-8 (no BOM) format support?
Diamen, did you try to experiment with the codepage settings in the Options -> Settings -> General ?
Such as:
- set "Codepage recognition" to "Western European"
- set "Default codepage" to "65001"
- set "New file" to "65001" without BOM.
Such as:
- set "Codepage recognition" to "Western European"
- set "Default codepage" to "65001"
- set "New file" to "65001" without BOM.
-
Offline
- Posts: 165
- Joined: Fri Aug 15, 2008 8:58 am
Re: UTF-8 (no BOM) format support?
When I use your setting with:
test òà.
I save it as 1251 Ansi
when I reopen Akelpad recognize as UTF- NO BOM and not display accented and point.
Display onlye
"test "
test òà.
I save it as 1251 Ansi
when I reopen Akelpad recognize as UTF- NO BOM and not display accented and point.
Display onlye
"test "
-
Offline
- Posts: 1292
- Joined: Thu Nov 16, 2006 11:53 am
- Location: Kyiv, Ukraine
Re: UTF-8 (no BOM) format support?
Looks like there is some misunderstanding.
The topic says "UTF-8", so I proposed to specify the codepage "65001" that corresponds to "UTF-8".
The "UTF-8" encoding/codepage by its nature uses multiple bytes per each non-Latin character such as "òà" you mentioned.
But then you write "I save it as 1251 Ansi". The "1251" is an Ansi encoding/codepage that uses single byte per each character, including non-Latin characters. Which means each non-Latin character such as "ò" and "à" is truncated to a single byte, and this single byte can not be properly interpreted as a non-Latin character unless your system's Ansi encoding contains these characters. To be sure these "ò" and "à" characters are properly saved and then properly displayed on any system, you should save your file as "UTF-8".
The topic says "UTF-8", so I proposed to specify the codepage "65001" that corresponds to "UTF-8".
The "UTF-8" encoding/codepage by its nature uses multiple bytes per each non-Latin character such as "òà" you mentioned.
But then you write "I save it as 1251 Ansi". The "1251" is an Ansi encoding/codepage that uses single byte per each character, including non-Latin characters. Which means each non-Latin character such as "ò" and "à" is truncated to a single byte, and this single byte can not be properly interpreted as a non-Latin character unless your system's Ansi encoding contains these characters. To be sure these "ò" and "à" characters are properly saved and then properly displayed on any system, you should save your file as "UTF-8".