开发者

How to serialize a string with double byte characters?

开发者 https://www.devze.com 2023-01-16 06:22 出处:网络
I want to serialize a string (Korean string) containing double byte characters. Do I need to do something special?

I want to serialize a string (Korean string) containing double byte characters. Do I need to do something special?

I am able to seria开发者_高级运维lize char * strings by escaping special characters like \n,\b,\f,\t etc.

I am using C++ on Windows without any libraries.


You want to transform a Unicode string in bytes. An Unicode string can be represented in many ways in memory so you need to encode it. I

I recommend to use UTF-8 encoding for this because it the most used encoding it that is also independent of machine endianess.

0

精彩评论

暂无评论...
验证码 换一张
取 消