I would like to offer my add-on in 2 different languages,
so I added a folder named 'locale' with en-US.properties and de-DE.properties in it.
For the German umlaute ä, ö, ü and for the letter ß I tried different encodings, none
of them working. Is there a way to mask them?
And, btw, is it slowing the add-on down considerably working with data-attributes for
every single text-node in the html-files of the addon-panels?
There is a possibility.
You can use:
Ä = Ä
Ü = Ü
Ö = Ö
ä = ä
ü = ü
ö = ö
For german ß (called eszett) use
ß = ß
Related
I have a problem with zebra printer ZT410, i'm trying to print in latin characters such as ñ, ç and ò and so on.
^XA
^CI28
^MMT
^PW1040
^LL840
^A#N,50,49,E:STI000.FNT^FT50,-230^FH\^FDRajoy^FS
^A#N,50,49,E:STI000.FNT^FB1040,2,25,C^FT0,-421^FH\^FDThañk yòú fôr showing me that there are people^FS
^A#N,50,49,E:STI000.FNT^FB1040,1,0,C^FT0,-509^FH\^FDlike you in this world.^FS
^A#N,50,49,E:STI000.FNT^FB1040,1,0,C^FT0,-572^FH\^FD^FS
^A#N,50,49,E:STI000.FNT^FB1040,1,0,C^FT0,-635^FH\^FDLoveç you.^FS
^A#N,50,49,E:STI000.FNT^FB1040,1,0,C^FT0,-698^FH\^FDMarta.^FS
^A#N,50,49,E:STI000.FNT^FT50,-790^FH\^FDDavid^FS
^XZ
But instead of printing the special characters, they are omited, I've checked that the special font used (Stingray) contains all those characters, I don't know how to print them. Any help would be appreciated. Thanks
Edit: I actually fixed it by using ^CI27 instead of ^CI28 since I have an older version of the Zebra firmware that doesn't support ^CI28
Here's something simple that works with some of the text you have:
^XA
^CI28
^FO50,20^A0N,40,40^FDThañk yòú fôr showing me that there are people^FS
^XZ
My question is about printing French characters with an acute like: é è à ô etc. with a Zebra P4t printer.
Consider the ZPL instructions below:
^XA
^FO20,20
^CI28
^A0,20,20
^FD
Amitié
^FS
^XZ
I have put these instructions into a file encoded as UTF-8.
When I send this file to a Zebra GK420t printer, I get the expected result concerning the character with an acute é at the end of the French word Amitié that you can see above. It is printed properly.
Now, when I send this very same file to a Zebra P4t printer it prints something like |-® instead of the é character.
The firmware of the printer is SHCPT11z48.
Alos, if you consider the ZPL instructions below:
^XA
^FO20,60
^A0,20,20
^FD
Amitié
^FS
^XZ
I have put these instructions into a file encoded as ANSI.
Now, when I send this very same file to a Zebra P4t printer it prints Ú instead of the é character.
I really don't see where this character Ú is coming from.
What can I do to solve that problem?
Is a font missing in the printer?
Am I not sending compatible ZPL instructions?
Thank you and best regards.
You have to prefix the field with UTF-8 characters with ^FH (Field Hexadecimal Indicator) and replace every UTF-8 character with their unicode hexadecimal code prefixed by an _ (list, example for é):
^XA
^FO20,20
^CI28
^A0,20,20
^FD
Amiti_C3_A9
^FS
^XZ
Simple solution without having to replace anything:
After the opening tag ^XA add ^CI28.
^XA^CI28
your content
^XZ
Zebra support talking about it here.
If I send the ZPL commands below to a Zebra printer, it prints AmitiÙ:
^XA
^FO50,20
^CI7
^A0N,25,15
^FD
Amitié
^FS
^XZ
Note that the file encoding is ANSI.
Note the use of the ZPL command ^CI7 (7 => Single Byte Encoding - France 1 Character Set).
On the other hand, if I send the ZPL commands below to a Zebra printer, it prints Amitié (which is what I actually need to get):
^XA
^FO50,20
^CI28
^A0N,25,15
^FD
Amitié
^FS
^XZ
Note that the file encoding is UTF-8.
Note the use of the ZPL command ^CI28 (28 => Unicode (UTF-8 encoding) - Unicode Character Set).
Do you know what's wrong in the first case?
Thank you for helping.
Use UTF-8 by placing a ^CI28 command at the top of your ZPL template, eg
^XA
^CI28
^CF0,80
^FO70,40^FDavión^FS
^XZ
According to the programing guide document from Zebra ^CI using 7 will get you Code Page 850 with some specific character replacements. When you say you had the file encoded in ANSI, I assume you mean Code Page Windows-1252 or ISO-8859-1 (latin1).
The character é in Windows-1252 and latin1 is #00E9, but that's Ú in 850; you would want #0082 for é in 850. Using ^CI7 you could apparently also get an é with #007B since that's one of the specific character replacements made with that command.
Using UTF8 (with ^CI28) is probably the way to go since it's widely supported and understood, but note that you could also try ^CI27 (which may work even if you have an older version of the Zebra firmware that doesn't support ^CI28) and that should get you code page 1252. If that doesn't work you'll need to encode your text using code page 850.
If you copy and paste your first example into a text editor that can convert between UTF-8 and ANSI (Notepad++) you'll see that the first example is encoded as
^XA
^FO50,20
^CI7
^A0N,25,15
^FD
Amitié
^FS
^XZ
And this will be cause problems with your ZPL when rendered. See online examples for ANSI and UTF-8.
To fix this you could encode your values first (for example as hex and then prefix with ^FH)
Here is what I did to be able to do that:
Define UTF-8 charset using ^CI28
Use Swiss unicode font. For my case I only needed to encode on a single line and I didn't want to change anything else on the document or printer settings. For that I used ^A#N,44,30,E:TT0003M_.TTF. If you want to define the font for the whole document check the first link below.
Prepared the string to recognize UTF-8 encoding with ^FH immediately before ^FD
Encoded the document to replace non-ASCII characters with their HEX representation:
private static string ZebraEncode(string text)
{
var ret = new StringBuilder();
var unicodeCharacterList = new Dictionary<char, string>();
foreach(var ch in text)
{
if (!unicodeCharacterList.ContainsKey(ch))
{
var bytes = Encoding.UTF8.GetBytes(ch.ToString());
if (bytes.Length > 1)
{
var hexCode = string.Empty;
foreach(var b in bytes)
{
hexCode += $"_{BitConverter.ToString(new byte[] { b }).ToLower()}";
}
unicodeCharacterList[ch] = hexCode;
}
else
unicodeCharacterList[ch] = ch.ToString();
ret.Append(unicodeCharacterList[ch]);
}
else
ret.Append(unicodeCharacterList[ch]);
};
return ret.ToString();
}
Info that I gathered in order to reach a solution:
Downloading and using fonts on zebra zpl printers
ZPL Online editor
A mix from the answers for this question
I am facing issue with Wingdings character. Few unicode characters are not coming properly in the PDF output. Below two characters are present in Wingdings font, but it is not coming when I use wkhtmltopdf.
ý U+00FD
þ U+00FE
http://www.alanwood.net/demos/wingdings.html
Any help is appreciated!
I am working on language transliteration for Ar and En text.
Here is the link which displays character by character replacement : https://github.com/Shnoulle/Ar-PHP/blob/master/Arabic/data/Transliteration.xml
Now issue is:
I am dealing with font style robert_bold.ttf and robert_regular_0.ttf which has some typical characters with underline and overline as in this snap
I have .ttf file so I can see this fonts on my system. But in my application or in above Transliteration.xml characters are considered as junk like [, } [ etc.
How can I add support of this unsupported characters in Transliteration.xml file?
<pair>
<search>ي</search>
<replace>y</replace>
</pair>
<pair>
<search>ى</search>
<replace>a</replace>
</pair>
<pair>
<search>أ</search>
<replace>^</replace> // Here is one of the character s_ (s with underscore not supported)
</pair>
It seems that the font is not Unicode encoded but contains the underlined letters at some arbitrarily assigned codes. While this works up to a point, it does not work across applications, of course. It works only when that specific font is used.
The proper way is to use correct Unicode characters such as U+1E0F LATIN SMALL LETTER D WITH LINE BELOW “ḏ” and, for rendering, try to find fonts containing it.
An alternative is to use just basic Latin letters with some markup, say <u>d</u>. This means that the text must not be treated as plain text in later processing, and in rendering, the markup should be interpreted as requesting for a line under the letter(s).