Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Questions and Answers >> importing utf-16 notes
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1187347021

Message started by Stephen De Gabrielle on Aug 17th, 2007, 6:37am

Title: importing utf-16 notes
Post by Stephen De Gabrielle on Aug 17th, 2007, 6:37am

Hi I have a s-60 smartphone*, that I use for making notes 'the tinderbox way'  ;) 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

Title: Re: importing utf-16 notes
Post by Mark Bernstein on 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.

Title: Re: importing utf-16 notes
Post by Mark Anderson on 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.

Title: Re: importing utf-16 notes
Post by Mark Bernstein on 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


Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.