jEdit Community - Resources for users of the jEdit Text Editor
Directory Search Encoding
Submitted by Llelan D. on Thursday, 17 January, 2013 - 18:56
What encoding is used for the Search Directory function? Is it the global default, the currently active file encoding, something else?

Is there a way to specify what encoding to use to open the files in a Directory Search without temporarily changing the global default?
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Buffer-Local Property
by Robert Schwenn on Thu, 17/01/2013 - 20:55
I don't think that search can use another encoding than jEdit would use to open a buffer. If You think that the search uses a wrong encoding while looking into a file, You should try to ensure that this file would be opened with desired encoding when You'd open it manually.

I see these options:
a) In "Global Options -> Encodings": Set default and fallback encodings
b) Open the file manually and do "File -> Reload with encoding". Then, when You close and re-open the file, jedit should use the last encoding.
c) Set the Buffer-Local Property ":encoding=UTF-8:" in the first or last 10 lines of the file. This may be the safest method.
 
Thanks for the reply. c) i
by Llelan D. on Thu, 17/01/2013 - 22:28
Thanks for the reply.

c) is not possible since they are data files used by an application.
b) I discovered but it is not feasible since there are hundreds of files to search.
a) is what I'm trying to avoid changing.

The files are encoded Shift_JIS, which I've defined globally as a fallback encoding, but it does not work most of the time with these files.

The only way I've found to make this work is to temporarily change the global default encoding to Shift_JIS, do any searches, then change it back.

The Directory Search dialog should have a field that allows you to designate what encoding to use for the search. That would solve this nicely.
 
fallback encodings
by Robert Schwenn on Fri, 18/01/2013 - 17:34
To be clear:
Only when a file cannot be opened with the default encoding (without errors), the fallback encodings are used. Then, the FIRST fallback encoding that succeeds is used...
User login
Browse archives
« April 2024  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82348
Context Free Art (*.cfdg)   0.31   46055
JBuilder scheme   .001   18495
BBEdit scheme   1.0   18116
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293