English Boards > V3 Development

FOR DEVELOPER! Characters count method for Unicode character

(1/2) > >>

sukasem:
Hi there,
I just came across this useful method to count strings in Unicode format, useful for foreign languages. Since, ticket template format base on number of characters in each line so, the string length in regular method will result wrong formatting.

Here the solution:
http://stackoverflow.com/questions/12739648/number-of-characters-in-java-string

Hopefully, Emre will implement this in to next release ;)

Cheers,
Sukasem

emre:
Can you give more details about your problem? We already have some similar features.

sukasem:
In Thai, some characters is mark as replace so, it won't take up the space because it place on top or bottom of previous character.
I think that post gave very clear picture ;)

In their example, if you count characters regularly it have 7 characters but 2 are placed on top of the previous one (the on that mark as dash circle).

emre:
I understand that. Did you see this one before? https://github.com/emreeren/SambaPOS-3/issues/232

sukasem:
Yes I saw it. But I still have this issue with 3.0.27.
I am not sure if you will see this correctly.

░░░░░░░░░░░░░░░ T i c k e t ░░░░░░░░░░░░░░
Date:9/20/2013                           
Time:9:30 AM                             
Table: B12                               
Ticket No:8                               
------------------------------------------
- 1 Toasted Bagel Jam ไม่เอาเห็ด      1.50
- 1 Toasted Bagel Cheese              2.25
==========================================
Total:                                5.51
==========================================
            T H A N K   Y O U             

Navigation

[0] Message Index

[#] Next page

Go to full version