Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
importing utf-16 notes (Read 6056 times)
Stephen De Gabrielle
Full Member
*
Offline



Posts: 13

importing utf-16 notes
Aug 17th, 2007, 6:37am
 
Hi I have a s-60 smartphone*, that I use for making notes 'the tinderbox way'  Wink while on the train.

The supplied 'Notes' app is nice, but creates utf-16 on export; which confuses many apps including tinderbox.

Does anyone have any advice for smoothing my workflow with importing these notes?, as I currently have to load them with textedit, then save as utf-8.

Cheers,

stephen


* Nokia e65, but this applies to the N70, and I assume to any smartphone with the notes application
Back to top
 
 
WWW Stephen De Gabrielle spdegabrielle@yahoo.com   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: importing utf-16 notes
Reply #1 - Aug 17th, 2007, 11:03am
 
Can someone provide a command-line filter that converts UTF-16 on stdin to MacRoman on stdout?  With this, it would be easy.

We'll add a boolean User attribute, Converted, which defaults to false.  Then the rule

    if(!Converted) {Text=runCommand(ConvertFromUnicode,$Text);Converted=true;}

would do the trick.
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: importing utf-16 notes
Reply #2 - Aug 17th, 2007, 11:51am
 
Would this help? http://latcarf.com/blog/archives/68-iconv-Character-Set-Conversion.html It appears to describe what you want but I'm not an experienced enough scripter to say it it works.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: importing utf-16 notes
Reply #3 - Aug 17th, 2007, 12:29pm
 
Yep: that appears to be what we need. So the command would be

    if(!Converted){Text=runCommand("iconv -f UTF-16 -t MacRoman",$Text),Converted=true;}

for information on iconv, open a terminal window and type

     man iconv

Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print