Processing Line-breaking Characters

To ensure that line-break characters are correctly transcoded between Unicode and a host character set, use the ILineBreakConverter class, either to preprocess strings before converting them to a host character set or to postprocess strings after converting them into Unicode.

To use ILineBreakConverter:

  1. Call the static function convert or convertInPlace. convert returns a new IText with the converted string. convertInPlace operates directly on the IText you pass in.
  2. When preprocessing strings for conversion to a non-Unicode character set, you must specify the convention to use. You can specify a particular convention or ILineBreakConverter::kHost, which uses the convention for the current host.

For example, this code shows how to postprocess line breaks after conversion into Unicode, then preprocess for conversion back to the original character set:

transcoder->toUnicode(hostText, unicodeText);

// After transcoding, postprocess the line breaks.

ILineBreakConverter::convertInPlace(unicodeText);



// ...Operate on unicodeText



// Before transcoding out of Unicode, preprocess the line 
breaks

ILineBreakConverter::convertInPlace(unicodeText, 

				ILineBreakConverter::kHost);

transcoder->fromUnicode(unicodeText, hostText);


Transcoding Classes
Transcoder Names