Java escpos字符集编码

编程入门 行业动态 更新时间:2024-10-28 11:18:34
本文介绍了Java escpos字符集编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我必须打印原始文本打印机,而我必须设置代码页字符集。我发现最适合我的应用程序的字符集是IBM858。 现在的问题是将字符串编码到此代码页。

i have to print a raw text printer where i have to se the codepage charset. I found that the best charset for my application is the IBM858. Now the problem is to encode the strings to this codepage.

我尝试了此操作:

test = new String("#$@°\\è^ùàòèì\n".getBytes(),"Cp858"); file.write(test.getBytes());

但字符不匹配。

推荐答案

这会将UTF-16字符串编码为Cp858:

This encodes the UTF-16 string as Cp858:

file.write("#$@°\\è^ùàòèì\n".getBytes("Cp858"));

更多推荐

Java escpos字符集编码

本文发布于:2023-11-09 19:30:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573231.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符集   Java   escpos

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!