• Resolved softpiano

    (@softpiano)


    Hello. My problem is that when a pdf invoice is generated, there are no Lithuanian characters. These letters are ignored and do not represent on the pdf at all.

    I read about this issue and i know that i should use custom fonts, but the problem remains, after i use any custom font. I can see the font change on the pdf, so i assume i do everything correct, but still – no Lithuanian characters are shown. Please help me to sort that thing out..

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! From your description it sounds like this is not actually a font issue (I believe lithuanian is supported out of the box), but a server configuration issue. On the ‘Status’ tab of the PDF invoice settings, do you see PHP MBString marked red or orange?

    Ewout

    Thread Starter softpiano

    (@softpiano)

    Hi. Thanks for your reply. I can see green YES. I also checked my server mysql settings and everything is set to utf.. All my website shows Lithuanian characters without any problems. Every place i know is set with utf..

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! It’s not UTF that is the problem (the invoice is always created in UTF8), but possible character encoding conversions along the way. In that sense you cannot compare this to other parts of your site. I just tested on my own site with the default Simple template (=Open Sans font) and got the correct output:
    Lithuanian dummy text

    Ewout

    Thread Starter softpiano

    (@softpiano)

    So what is the problem?

    Plugin Contributor Ewout

    (@pomegranate)

    Something in your server configuration.
    I recommend contacting your host to ask if they can confirm that indeed PHP MB String is properly installed. All similar previous reports turned out to be MB String related.

    Thread Starter softpiano

    (@softpiano)

    I can see this information about MB String:
    Multibyte Support: enabled
    Multibyte string engine: libmbfl
    HTTP input encoding translation: disabled
    libmbfl version: 1.3.2
    oniguruma version: 5.9.6
    mbstring.detect_order no value no value
    mbstring.encoding_translation Off Off
    mbstring.func_overload 0 0
    mbstring.http_input no value no value
    mbstring.http_output no value no value
    mbstring.http_output_conv_mimetypes ^(text/|application/xhtml\+xml) ^(text/|application/xhtml\+xml)
    mbstring.internal_encoding no value no value
    mbstring.language neutral neutral
    mbstring.strict_detection Off Off
    mbstring.substitute_character no value no value

    Does that tells smth?

    • This reply was modified 7 years, 9 months ago by softpiano.
    Thread Starter softpiano

    (@softpiano)

    P.S. And i was confirmed by a hosting provider, that MB String is installed and enabled.

    Thread Starter softpiano

    (@softpiano)

    P.P.S. Just to make it clear: There is no problem for example with a product description name. It shows LT characters. But the problem with LT characters is when i edit the invoice.php file and add my custom text there with echo comand, or change the title manualy (document-type-lable ‘Invoice’), o change other text like ‘Invoice Number:’.. I guess that gives better view of my problem.. I’m working under my child theme and custom invoice tempate.

    Plugin Contributor Ewout

    (@pomegranate)

    Hi!
    That certainly clarifies the issue. In that case it’s probably an issue with the text editor saving in an encoding that is different from the encoding on your site. The strings you mention should be changed in the translations rather than the template itself. I recommend using Loco Translate.
    For custom text you’re echoing, you could apply htmlspecialchars() to avoid encoding issues altogether. for example:

    
    <?php echo htmlspecialchars('Visi ?mon?s gimsta laisvi ir lygūs savo orumu ir teis?mis. Jiems suteiktas protas ir s??in? ir jie turi elgtis vienas kito at?vilgiu kaip broliai.'); ?>
    

    Hope that helps!
    Ewout

    Thread Starter softpiano

    (@softpiano)

    Does not work.. the line is not represented in the document.. tried with $str as well..

    Plugin Contributor Ewout

    (@pomegranate)

    with echo htmlspecialchars( $str );? Just htmlspecialchars( $str ) only performs the conversion.

    • This reply was modified 7 years, 9 months ago by Ewout.
    Thread Starter softpiano

    (@softpiano)

    Yes but the line is not represented on the document.. nothing appears in that place when using this line.
    `<?php echo htmlspecialchars(‘Visi ?mon?s gimsta laisvi ir lygūs savo orumu ir teis?mis. Jiems suteiktas protas ir s??in? ir jie turi elgtis vienas kito at?vilgiu kaip broliai.’); ?>

    • This reply was modified 7 years, 9 months ago by softpiano.
    Plugin Contributor Ewout

    (@pomegranate)

    I tested this myself and it works here. does something like

    
    echo 'test 1';
    echo htmlspecialchars( 'test 2' );
    

    show both lines?

    Thread Starter softpiano

    (@softpiano)

    Strange. I can see both words when they are test1 and tes2, but when i input text with LT characters, this line is not shown at all..

    Ewout, let me tell you that i’m really thankful that you are helping me on this matter. I appreciate your help. I really hope we’ll be able to sort this thing out. Amazing plugin all in all!

    Plugin Contributor Ewout

    (@pomegranate)

    I’m flat out of ideas here. It all works in my own development environment so it’s difficult to see what’s going wrong here. The only thing I can think of would be to use a different text editor. What are you using now?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘No Lithuanian language characters in PDF invoice’ is closed to new replies.