views:

56

answers:

2

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

I am able to serialize char * strings by escaping special characters like \n,\b,\f,\t etc.

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

+1  A: 

It would help if you stated what you mean by 'serialize'; Are you transporting the string through any other services or apps? Is it going to a database? Via XML?

Your input string will be of some kind of encoding (assuming UTF-16); Do you mean to ask how to change to another encoding (UTF-8, ASCII)?

Iain Ballard
This should be a comment on the questuion, not an answer...
Frank Bollack
sorry -- S.O. isn't allowing me to comment on questions!
Iain Ballard
A: 

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.

Sorin Sbarnea