jed-users mailing list

[2008 Date Index] [2008 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: iconv module documentation or examples?


On 26.08.08, Dino wrote:
> > From: Marko Mahnic
> > G. Milde wrote:
> > > ... Does anyone have experience or working examples on how to
> > > convert a buffer or a string using the iconv module?

> While I'm very very busy both at work (my company has been merged with
> another) and at home (I have a baby to play with, so no more free time to
> hack Jed), 

Congratulations!

> I took a little bit of time to write a simple script using the iconv
> module. This is an 'iconv' command line program implementation in
> Slang, and tries to be compatible with the iconv program present in
> almost all linux distributions.

Thanks, this will serve me as a starting point to use the iconv module
for utf8helper.sl (http://jedmodes.sf.net/mode/utf8helper/). Before
re-inventing the wheel, I will have to check your charset.sl script, too.

> Using is very simple: run it as 

> slsh testiconv.sl -f encoding_in -t encoding_out [filein] [fileout]

According to the man page here, the interface is slightly different:

  iconv -f encoding [-t encoding] [inputfile]...
  
i.e. the "-t encoding" is optional, defaulting to the current locale's
encoding. 

Just curious: how could I find out the (iconv-compatible) name of the
current locale's encoding in a S-Lang script?

... [leaving the patch to John]

> Also, I would like to have the 'testiconv.sl' script added to the
> 'slsh/scripts' directory in the Slang repository (maybe renamed simply
> to 'iconv').

This would clash with iconv.sl the already existing module wrapper.
How about slsh/examples/iconv-cli.sl?

> BTW, I still think that always working in UTF-8, and converting when
> loading or saving files. 

This is what utf8helper.sl provides (for latin1 vs. UTF-8 encoded
files) with high configurability.

> A detailed conversation about this can be found on message
> http://ruptured-duck.com/jed-users/msg01836.html, and other messages linked
> there. There is also an attachment containing my 'charset.sl' script, this
> may be useful as extracting the files from a windows installer my not be so
> easy.

I only found a zip file containing a patch with 

--- ..\john\jed/lib/_charset.sl	1970-01-01 01:00:00.000000000 +0100
+++ jed/lib/_charset.sl	2005-08-01 14:13:35.795000000 +0200

so I would appreciate if you could send me a copy of your charset.sl.

> Hope this helps,

Yes, thanks

Günter


--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2008 date index] [2008 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]