Jump to content

Recommended Posts

Posted

Hi all,

I have a problem with print tasks.

I find the limitations in this link: https://www.autoitscript.com/autoit3/docs/intro/unicode.htm

Seem Autoit V3 not support Unicode Encoding when working with printer? :(

Current Limitations

There are a few parts of AutoIt that don't yet have full Unicode support. These are:

These limits will be addressed in future versions if possible.

Any one can help me. :)

  • Developers
Posted (edited)

How did you determine it doesn't work with printer?
What exactly are you trying that doesn't work?

Jos

ps: Moved to the support forum
pss: I see you are dropping the same question at multiple places in our forums...  please don't to avoid confusion.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Hi Jos,

I posted two questions on different topics because i think  the cause of the error can be in this topic or the other, i would be happy if you did not consider it spam. :) 

Anw, i'm doing some printing jobs with a bill printer (Epson), using Martin's UDF and dll (http://www.mosaiccgl.co.uk/AutoItDownloads/confirm.php?get=PrintMG.zip).

I tried to print directly on Windows then the result is OK, but when I try to do it via the Autoit command, the result is a text string that has been converted from Unicode UTF 8 with BOM to ANSI encoding, error occurred on both printers: bill printer (EPSON TM-T81II) and nomal printer (FX DocuPrint P265 dw)m like this:

TI?NG VI?T
VI?T NAM

Below is my example code:

I try to find out the reason of error, and read this offical link https://www.autoitscript.com/autoit3/docs/intro/unicode.htm .

Anybody in this forum printing unicode character with the printer OK? Please share me the sample code. :)

Best regards ,

I repost my example code, because i'm not see the editing function to edit post. :( 

#include <MsgBoxConstants.au3>
#include <printMGv2.au3>
#include <WinAPIFiles.au3>
#include <Array.au3>
#include <WindowsConstants.au3>
#include <ArrayWorkshop.au3>


Global $hp

Global $bill_print[20][2]

$t1 = "TIẾNG VIỆT"
$t2 = "VIỆT NAM"
;$t1_unicode = Stringtobinary($t1 & @CRLF,4)
;$t2_unicode = Stringtobinary($t2 & @CRLF,4)

For $i = 0 To 2
    $bill_print[$i][0] = $t1
    $bill_print[$i][1] = $t2
Next

_ArrayDisplay($bill_print, "Unicode Encoding Test")

Func Bill($column1)
Local $mmssgg,$marginx,$marginy
$hp = _PrintDllStart($mmssgg)
if $hp = 0 then
    consolewrite("Error from dllstart = " & $mmssgg & @CRLF)
    Exit
endif
_PrintPageOrientation($hp,1); 0-landscape, 1-portrait
_PrintStartPrint($hp)

_PrintSetFont($hp,'Times New Roman',15,0,"bold")
$th = _PrintGetTextHeight($hp,$column1[0][1])

For $n = 0 To 2
    If $column1[$n][0] = 0 Then ExitLoop
    _PrintText($hp,$column1[$n][0], 80, $th)
    _PrintText($hp,$column1[$n][1], 500, $th*2)
Next

_PrintEndPrint($hp)
_PrintNewPage($hp);
_printDllClose($hp)
EndFunc

 

  • Developers
Posted (edited)
39 minutes ago, Earthshine said:

 Edit link is in lower left hand corner of your post, around where it says Quote ;-)

Not for @CocCoc as his staus doesn't allow that yet.  Will come when enough posts are made.

51 minutes ago, CocCoc said:

I repost my example code, because i'm not see the editing function to edit post.

The #include <printMGv2.au3>  isn't a standard UDF livbrary so that would be a good place to start to figure out why.
It always helps to post the reference to the used none standard udf's as I wouldn't know what that file contains.
Ah .. you actually did that already.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...