Skip to content
Snippets Groups Projects
Commit 90229329 authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

save the encoding in the note file

parent 9a5d0559
No related branches found
No related tags found
No related merge requests found
...@@ -522,7 +522,7 @@ sub save ...@@ -522,7 +522,7 @@ sub save
my $note= shift; my $note= shift;
my $out_dir= shift; my $out_dir= shift;
my $fnm_out= shift; my $fnm_out= shift;
my $no_utf8= shift; my $no_utf8= shift; # NOTE: this is experimental for the (broken) Android version of Tomboy (Tomdroid or so)
# refresh lines, if they are not up-to-date # refresh lines, if they are not up-to-date
$note->update() unless ($note->{'flg_lines'}); $note->update() unless ($note->{'flg_lines'});
...@@ -558,10 +558,12 @@ sub save ...@@ -558,10 +558,12 @@ sub save
} }
my $out_mode= '>:utf8'; my $out_mode= '>:utf8';
my $xml_encoding= 'utf-8';
if ($no_utf8) if ($no_utf8)
{ {
print "save with no utf8!\n"; print "save with no utf8!\n";
$out_mode= '>:encoding(iso-8859-7)'; $out_mode= '>:encoding(iso-8859-7)';
$xml_encoding= 'iso-8859-7'; # TODO: or whatever XML needs here..
} }
unless (open (FO, $out_mode, $fnm_out)) unless (open (FO, $out_mode, $fnm_out))
...@@ -573,8 +575,8 @@ sub save ...@@ -573,8 +575,8 @@ sub save
print "writing note [$fnm_out]: [$title]\n"; # TODO: if verbose print "writing note [$fnm_out]: [$title]\n"; # TODO: if verbose
print FO chr(65279); # write a BOM, Tomboy seems to like that print FO chr(65279); # write a BOM, Tomboy seems to like that
print FO <<EOX; print FO <<"EOX";
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="$xml_encoding"?>
<note version="0.3" xmlns:link="http://beatniksoftware.com/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size" xmlns="http://beatniksoftware.com/tomboy"> <note version="0.3" xmlns:link="http://beatniksoftware.com/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size" xmlns="http://beatniksoftware.com/tomboy">
EOX EOX
print FO ' <title>'. Util::XML_Parser_Tree::tlt_str($title) ."</title>\n"; print FO ' <title>'. Util::XML_Parser_Tree::tlt_str($title) ."</title>\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment