mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
...
This commit is contained in:
parent
bd351b055f
commit
adf3d06da7
@ -6,11 +6,10 @@ namespace pkpy{
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
// Skip utf8 BOM if there is any.
|
// Skip utf8 BOM if there is any.
|
||||||
if (strncmp(source.begin(), "\xEF\xBB\xBF", 3) == 0) index += 3;
|
if (strncmp(source.begin(), "\xEF\xBB\xBF", 3) == 0) index += 3;
|
||||||
// Replace all '\r' with ' '
|
// Drop all '\r'
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
while(index < source.length()){
|
while(index < source.length()){
|
||||||
if(source[index] == '\r') ss << ' ';
|
if(source[index] != '\r') ss << source[index];
|
||||||
else ss << source[index];
|
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user