I think literal strings should be accepted.
If I put characters from other streams, I will encode/decode them.
Other case, I tried to set Japanese font on paragraph, but it is not worked.
(attached file.)
Would you tell me how to set font name ?
Best Regards.
Yasuto,
2015-08-20 5:24 GMT+09:00 Karen Etheridge via RT <bug-ODF-lpOD@rt.cpan.org>:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=106541 >
>
> On 2015-08-19 12:40:36, yasuto.sh7@gmail.com wrote:
> > Hi,
> > This is a request. But fix this shortly please.
> >
> > To insert unicode strings, I have to change unicode flag on every
> strings.
> > Please check flags and change it if necessary.
> >
> >
> > #!/usr/bin/perl
> > use strict;
> > use utf8;
> > use ODF::lpOD;
> >
> > my $doc = odf_new_document('text');
> > my $meta = $doc->meta;
> >
> > $meta->set_title("Title");
> >
> > my $text = "こんにちは"; # 'Hello' in Japanese
> > utf8::encode($text); # need this
> >
> > my $context = $doc->get_body;
> > my $p = odf_create_paragraph(
> > text=> $text,
> > style=>"Standard");
> >
> > $context->insert_element($p);
>
>
> Checking the is_utf8 flag on the string is not correct -- but the API
> should assume that it is receiving characters (unicode), rather than bytes
> that are already encoded into utf8.
>
> It is only when serializing/deserializing at the boundaries of an
> application that encoding/decoding should occur.
>