English 中文(简体)
• 如何用阿拉伯语向《法典》1001发出?
原标题:How to Convert UTF-8 Arabic letters to CodePage 1001?

我有一个支持1001阿拉伯语的Star Micronics TSP,我如何利用C#将UTF-8改为该特定代码网页?

最新情况:我发现,第864号法典与打印机相容,我试图寄出海产值,我直言行正确,

myPrinter.PrintNormal(PrinterStation.Receipt, "xFE8D");

我试图将体力转换为864年编码:

Encoding enc = Encoding.GetEncoding(864);
byte[] arr = enc.GetBytes("السلام");

编码之后的附位数值一米。 这种做法在价值上是错误的,甚至由于它具有双重特异性而是错误的。

最佳回答

未经测试,但:

String s = Encoding.UTF8.GetString(bytes);
Encoding enc = Encoding.GetEncoding(1001);
byte[] arr2 = enc.GetBytes(s);

当然,如果你实际上从扼杀手头开始,那么,从你提到UTF-8 I就算了双手。

很明显,对于大量数据,你可以使用<代码>TextReader/TextWriter(每个编码都有编码)。

问题回答

i don t think the original person who asked still needs the answer but this thread seems pretty famous and i don t want anyone to waste his time to find what i found the hard way..so

this answer relies primarily on the application provided with the Star Micronics TSP printer

key points: - reference "Interop.OposPOSPrinter_CCO.dll" - the printer object should be of type oposposprinter.printer and is initialized in a slightly different way (compared to opos.net) - the character codes are sent as a string and there s a variable to tell the printer object to use these decimal numbers as character codes

a 样本VB。 有一个简单的阿拉伯字母转换器的净项目可在https://bitbucket.org/loody/Depts/查询。

注:一无时间涵盖信函/编号的其余部分





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签