@@ -314,93 +314,6 @@ bool MCCStringFromUnicode(const unichar_t *p_unicode_string, char*& r_string)
314314
315315// //////////////////////////////////////////////////////////////////////////////
316316
317- // BWM-2017-08-16: [[ Bug 17810 ]] Restore line endings of script-only-stack to
318- // match how they were when originally imported.
319- bool MCStringConvertLineEndingsFromLiveCode (MCStringRef p_input,
320- bool p_use_LF_line_endings, bool p_use_CR_line_endings, MCStringRef& r_output)
321- {
322- if (p_use_CR_line_endings)
323- {
324- MCStringRef t_mutable_input;
325- if (p_use_LF_line_endings)
326- {
327- /* UNCHECKED */ MCStringMutableCopy (p_input, t_mutable_input);
328- /* UNCHECKED */ MCStringFindAndReplace (t_mutable_input, MCSTR (" \n " ), MCSTR (" \r\n " ), kMCStringOptionCompareExact );
329- }
330- else
331- {
332- /* UNCHECKED */ MCStringMutableCopy (p_input, t_mutable_input);
333- /* UNCHECKED */ MCStringFindAndReplaceChar (t_mutable_input, ' \n ' , ' \r ' , kMCStringOptionCompareExact );
334- }
335- /* UNCHECKED */ MCStringCopyAndRelease (t_mutable_input, r_output);
336- }
337- else
338- {
339- r_output = MCValueRetain (p_input);
340- }
341-
342- return true ;
343- }
344-
345- bool MCStringConvertLineEndingsFromLiveCode (MCStringRef p_input, MCStringRef& r_output)
346- {
347-
348- #ifdef __CRLF__
349- MCStringRef t_mutable_input;
350- /* UNCHECKED */ MCStringMutableCopy (p_input, t_mutable_input);
351- /* UNCHECKED */ MCStringFindAndReplace (t_mutable_input, MCSTR (" \n " ), MCSTR (" \r\n " ), kMCStringOptionCompareExact );
352- /* UNCHECKED */ MCStringCopyAndRelease (t_mutable_input, r_output);
353- #elif defined(__CR__)
354- MCStringRef t_mutable_input;
355- /* UNCHECKED */ MCStringMutableCopy (p_input, t_mutable_input);
356- /* UNCHECKED */ MCStringFindAndReplaceChar (t_mutable_input, ' \n ' , ' \r ' , kMCStringOptionCompareExact );
357- /* UNCHECKED */ MCStringCopyAndRelease (t_mutable_input, r_output);
358- #else
359- r_output = MCValueRetain (p_input);
360- #endif
361-
362- return true ;
363- }
364-
365- bool MCStringConvertLineEndingsFromLiveCodeAndRelease (MCStringRef p_input, MCStringRef& r_output)
366- {
367- if (MCStringConvertLineEndingsFromLiveCode (p_input, r_output))
368- {
369- MCValueRelease (p_input);
370- return true ;
371- }
372- return false ;
373- }
374-
375- bool MCStringConvertLineEndingsToLiveCode (MCStringRef p_input, MCStringRef& r_output)
376- {
377- MCStringRef t_mutable_input;
378- /* UNCHECKED */ MCStringMutableCopy (p_input, t_mutable_input);
379- /* UNCHECKED */ MCStringFindAndReplace (t_mutable_input, MCSTR (" \r\n " ), MCSTR (" \n\r " ), kMCStringOptionCompareExact );
380- /* UNCHECKED */ MCStringFindAndReplace (t_mutable_input, MCSTR (" \n\r " ), MCSTR (" \n " ), kMCStringOptionCompareExact );
381- /* UNCHECKED */ MCStringFindAndReplace (t_mutable_input, MCSTR (" \r " ), MCSTR (" \n " ), kMCStringOptionCompareExact );
382-
383- // AL-2014-07-21: [[ Bug 12162 ]] Convert PS to LF, and LS to VT on text import.
384- /* UNCHECKED */ MCStringFindAndReplaceChar (t_mutable_input, 0x2028 , 0x0B , kMCStringOptionCompareExact );
385- /* UNCHECKED */ MCStringFindAndReplaceChar (t_mutable_input, 0x2029 , 0x0A , kMCStringOptionCompareExact );
386-
387-
388- /* UNCHECKED */ MCStringCopyAndRelease (t_mutable_input, r_output);
389- return true ;
390- }
391-
392- bool MCStringConvertLineEndingsToLiveCodeAndRelease (MCStringRef p_input, MCStringRef& r_output)
393- {
394- if (MCStringConvertLineEndingsToLiveCode (p_input, r_output))
395- {
396- MCValueRelease (p_input);
397- return true ;
398- }
399- return false ;
400- }
401-
402- // //////////////////////////////////////////////////////////////////////////////
403-
404317// Convert the given UTF-8 string to Unicode. Both counts are in bytes.
405318// Returns the number of bytes used.
406319int32_t UTF8ToUnicode (const char *p_src, int32_t p_src_count, uint16_t *p_dst, int32_t p_dst_count)
0 commit comments