Jump to content

Forcing UTF8+BOM encoding for every file in SciTE?


jchd
 Share

Recommended Posts

What I find strange is that I can paste Unicode e.g. 한국어 텍스트의 예 טקסט עברית ירושלים to the output console and it shows fine. ConsoleWrite is certainly not the culprit since is doesn't work either when launched with F5 (3.3.8.1), albeit it used to work fine with previous Scite4AutoIt3.

 

@Others,

Do you have any success with these settings?

SciTE interprets the input the way you tell it to or the way it makes sense to it. If you've set code.page=65001 then to print that string correctly (the way you expect it) you have to do something like this:

_ConsoleWrite("한국어 텍스트의 예 טקסט עברית ירושלים " & @CRLF)

Func _ConsoleWrite($sString)
    Return ConsoleWrite(BinaryToString(StringToBinary($sString, 4), 1))
EndFunc

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Yeah but you'd have to find commonly spread/available font(s) covering more. I now realize you're likely using musical symbols, so no charmap is impotent.

But then how do you handle encoding with surrogates?

 

There are always more bridges to cross right? I will have to take this into consideration and do some testing. I have not yet tried passing strings with surrogates to these functions. I will have to try.

Link to comment
Share on other sites

SciTE interprets the input the way you tell it to or the way it makes sense to it. If you've set code.page=65001 then to print that string correctly (the way you expect it) you have to do something like this:

_ConsoleWrite("한국어 텍스트의 예 טקסט עברית ירושלים " & @CRLF)

Func _ConsoleWrite($sString)
    Return ConsoleWrite(BinaryToString(StringToBinary($sString, 4), 1))
EndFunc

There is something strange here: I've been using flat ConsoleWrite with Unicode for years with repeatable success, just until recently.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

  • Administrators

ConsoleWrite definitely doesn't work with unicode. The API falls apart IIRC. I'd have to check the code for the details as I can't remember.

Edit: Strings are converted to ANSI. Binary is written directly.

Edited by Jon
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...