os.SaveString encoding?
Monkey Forums/Monkey Programming/os.SaveString encoding?
| ||
Does anyone what is the text encoding used to save strings on the os.SaveString function on the cpp target? |
| ||
I think it's UTF-8, as this (from lang.cpp -> String) checks whether or not a character within the string is > 254, then considers it Unicode (presumably treating it as ASCII otherwise):void Save( std::vector<unsigned char> &buf ){ bool uni=false; for( int i=0;i<rep->length;++i ){ if( rep->data[i]>=0xfe ){ uni=true; break; } } if( uni ){ ... }else{ ... } ... and one of the Load methods checks for a Byte-Order Mark. (And also contains the comment "//Illegal UTF8!".) |
| ||
Aaah ok, so it detects appropriate encodins as in BlitzMax. Great. Thanks! |