Hi,
I work on Windows Phone 8 application and wanna print some strings on POS printer (datecs-450). Printer is set to CE 1250 code page. Text is unicode. When I print some characters (š,c,ž,c,d) a get following characters: †á,-ž,†ž,-ç...
How to convert unicode character(string) to wp 1250 in windows phone 8?
Loading
Goran RisticPosted Apr 12, 2013, 9:37 AM
VulpesPosted Apr 12, 2013, 8:23 AM
Unless your printer can use UTF-8 as an alternative to Windows-1250, the only thing I can suggest is that you write your own encoding class.
There's a tool here which can automate the process so I'd give it a try:
http://www.hardcodet.net/2010/03/silverlight-text-encoding-class-generator
Goran RisticPosted Apr 12, 2013, 7:54 AM
1250 is not supported encoding name.
Parameter name: name
VulpesPosted Apr 12, 2013, 7:15 AM
using System.Text;
// ...
string s = "š,ž"; // or whatever
Encoding CE1250 = Encoding.GetEncoding(1250);
byte[] bytes = CE1250.GetBytes(s);