Home Download Buy Blog Forum Support

EncodingHelper ( Encoding on status bar, Convert to UTF8 )

EncodingHelper ( Encoding on status bar, Convert to UTF8 )

Postby tito on Thu Oct 20, 2011 7:24 am

Encoding Helper is a plugin which provides the following features:

  • Attempts to guess encoding of files
  • Show encoding on status bar
  • Convert to UTF-8 from a variete of encodings organized in a menu.
  • Convert to UTF-8 quickly from guessed encoding via menuitem
  • Convert to UTF-8 automatically when opening a file via some defined encodings found on User preferences

Image

Install and read the nice formatted description here:
https://github.com/SublimeText/EncodingHelper#readme

NOTE: Please note that by default encoding on status bar is false. You should set the preference to true via Preferences -> Package Settings -> Encoding Helper -> ..
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 851
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: EncodingHelper ( Encoding on status bar, Convert to UTF8 )

Postby solariz on Wed Nov 23, 2011 9:55 am

Thanks for this, I working with Windows MAC and Linux files and a good encoding controll is important!

Unfortunately I have a Problem on minimized Files, for example the jew jquery "jquery-1.7.min.js" if I open it in sublime2 no encoding is shown in the status bar. Other Files work like a charm.

http://trash.ctdo.de/b/042qheie106/CUserssolarizDocumentsMy-Dr.jpg

Thanks
solariz
 
Posts: 1
Joined: Wed Nov 23, 2011 9:28 am

Re: EncodingHelper ( Encoding on status bar, Convert to UTF8 )

Postby tito on Wed Nov 23, 2011 10:41 pm

Is not a problem with minimized files, is because guessing an encoding is an expensive task.
On my computer takes 8 seconds to guess the encoding for a jquery.js file.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 851
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: EncodingHelper ( Encoding on status bar, Convert to UTF8 )

Postby tito on Thu Jan 05, 2012 1:59 pm

This packages has been updated with minor tweaks and a new feature.

Now when sublime fails to detect the encoding, the package shows for example: "ISO-8859-1, Opened as UTF-8 (document probably broken)"

Sublime text provides API call view.encoding(). There is a bug with this API. Sometimes on the "on_load" event, view.encoding() is 'Undefined', probably because the event is dispatched before the encoding is detected.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 851
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: EncodingHelper ( Encoding on status bar, Convert to UTF8 )

Postby and7ey on Sat Jul 21, 2012 12:07 pm

Nice plugin, but looks too complex for me)
Could you please make another one with just one function - show encoding of the file in the status bar (near Syntax field)?

Thank you!
and7ey
 
Posts: 2
Joined: Sun Apr 08, 2012 7:31 pm

Re: EncodingHelper ( Encoding on status bar, Convert to UTF8 )

Postby tito on Sat Jul 21, 2012 8:31 pm

You can just set show_encoding_on_status_bar to true and forget everything else.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 851
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: EncodingHelper ( Encoding on status bar, Convert to UTF8 )

Postby Grant on Mon Jul 23, 2012 12:40 pm

It wasn't working for me.
I was getting this in my console:
Code: Select all
Traceback (most recent call last):
  File ".\EncodingHelper.py", line 26, in <lambda>
  File ".\EncodingHelper.py", line 58, in on_load
  File ".\EncodingHelper.py", line 81, in __init__
TypeError: 'NoneType' object is not iterable

It seems that since my "fallback_encodings" list in the default settings was empty, python didn't like it.
So I opened up the User settings file for EncodingHelper and set its contents to:
Code: Select all
{
   // To show encoding on status bar
   "show_encoding_on_status_bar" : true,

   // Additional encodings to test when no acurrated guess can be done
   // NOTE: Don't add ISO-8859-1
   "fallback_encodings": ["UTF-8", "ISO-8859-1", "UTF-16", "UTF-32"]
}

Now it works. Is this unexplained step expected, or did I miss something?

Thanks
Grant
 
Posts: 68
Joined: Fri Jan 20, 2012 2:42 pm

Re: EncodingHelper ( Encoding on status bar, Convert to UTF8 )

Postby tito on Mon Jul 23, 2012 1:07 pm

Mmm I can't reproduce your problem. Can you please remove and reinstall the package, restart sublime to see if the problem still hapens?
Maybe there was a syntax error or something into the file you had before.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 851
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: EncodingHelper ( Encoding on status bar, Convert to UTF8 )

Postby XeroXer on Wed Jul 25, 2012 1:26 pm

I would love to have the same setting that the LineEndings plugin. The possibility to set:
  • Display an alert when the line_ending is not some you expect.
https://github.com/SublimeText/LineEndings

I started looking into doing this myself but thought it would be better putting it into this plugin.
So for example we can set a setting like:
Code: Select all
"alert_when_encoding_is_not": ["UTF-8","ISO-8859-1"]

So every time I open a file which is none of those encodings I get an alert message, would be great.
XeroXer
 
Posts: 2
Joined: Wed Jul 25, 2012 1:22 pm
Location: Västerås, Sweden

Re: EncodingHelper ( Encoding on status bar, Convert to UTF8 )

Postby krysak4ver on Sat Aug 04, 2012 10:59 am

CONVERT TO: UTF-8
I switched from Notepad++ and I really miss this vital feature in Sublime Text

just found this package
but I have 2 major issues with this ST2 package

1.] DOES IT WORK ?
how precise it is, does it work only sometimes when in official settings is this comment ?
Code: Select all
   // Automatically opens as UTF-8 the following encodings list
   // NOTE: Encoding detection is not acurrated
   // don't abuse of this feature


I do not want to abuse it I want to use it
so ok it may or may not work ... which leads me to 2nd major issue

2.] CONVERT IT, no more
is there anywhere manual action simply and only ... Convert to UTF-8 ?
it is real pain to look at 100+ encodings in the menu and do not know how to just convert
I believe I am not the only one who does not know file encoding and does not really care as long as it can be unified into UTF-8
is there any feature like this ?

correct me if I am wrong or using it stupid on my side
but so far the only thing the plugin does by default is that it shows the encoding in status bar

shoot me, help me, anything, thanks
krysak4ver
 
Posts: 4
Joined: Sat Jul 21, 2012 9:17 am

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 8 guests