mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Fixed hex output in emitter (should be always two hex chars)
This commit is contained in:
@@ -2,8 +2,9 @@
|
|||||||
#include "exp.h"
|
#include "exp.h"
|
||||||
#include "indentation.h"
|
#include "indentation.h"
|
||||||
#include "exceptions.h"
|
#include "exceptions.h"
|
||||||
#include <sstream>
|
|
||||||
#include "stringsource.h"
|
#include "stringsource.h"
|
||||||
|
#include <sstream>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
namespace YAML
|
namespace YAML
|
||||||
{
|
{
|
||||||
@@ -82,7 +83,7 @@ namespace YAML
|
|||||||
} else {
|
} else {
|
||||||
// TODO: for the common escaped characters, give their usual symbol
|
// TODO: for the common escaped characters, give their usual symbol
|
||||||
std::stringstream str;
|
std::stringstream str;
|
||||||
str << "\\x" << std::hex << static_cast <int>(ch);
|
str << "\\x" << std::hex << std::setfill('0') << std::setw(2) << static_cast <int>(ch);
|
||||||
out << str.str();
|
out << str.str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user