LLVM 24.0.0git
llvm::ConverterEBCDIC Namespace Reference

Functions

LLVM_ABI std::error_code convertToEBCDIC (StringRef Source, SmallVectorImpl< char > &Result)
 Converts UTF-8 text containing only code points in the range U+0000 to U+00FF to EBCDIC-1047.
LLVM_ABI void convertToUTF8 (StringRef Source, SmallVectorImpl< char > &Result)

Function Documentation

◆ convertToEBCDIC()

std::error_code llvm::ConverterEBCDIC::convertToEBCDIC ( StringRef Source,
SmallVectorImpl< char > & Result )

Converts UTF-8 text containing only code points in the range U+0000 to U+00FF to EBCDIC-1047.

Returns std::errc::invalid_argument for incomplete UTF-8 input and std::errc::illegal_byte_sequence for malformed UTF-8 or code points outside that range.

Precondition
Result is empty. On error, it contains the successfully converted prefix.

Definition at line 93 of file ConvertEBCDIC.cpp.

References assert(), llvm::conversionOK, llvm::convertUTF8Sequence(), ISO88591ToIBM1047, isPotentiallyValidUTF8Prefix(), llvm_unreachable, llvm::sourceExhausted, llvm::sourceIllegal, llvm::strictConversion, and llvm::targetExhausted.

Referenced by emitPPA1Name(), printZOSMemberHeader(), and writeSymbolTable().

◆ convertToUTF8()

void llvm::ConverterEBCDIC::convertToUTF8 ( StringRef Source,
SmallVectorImpl< char > & Result )