I'm using rn-fetch-blob to read a utf-8 file. This file contains \n characters within its content. However, these \n characters aren't newline characters. They are two separate characters \ and n. In other words, when opening this file on a text editor, \n characters will be visible instead of a newline.
However, when reading the file with readFile, these characters are read as \n like a single newline character, instead of escaping the backslash and reading as \n.
import RNFetchBlob from 'rn-fetch-blob';
RNFetchBlob.fs.readFile('path-to-file');
UPDATE:
I have closed this issue as the error was due to a bug in my own code.
React Native version: 0.66.0 rn-fetch-blob version: 0.12.0
I'm using rn-fetch-blob to read a utf-8 file. This file contains \n characters within its content. However, these \n characters aren't newline characters. They are two separate characters \ and n. In other words, when opening this file on a text editor, \n characters will be visible instead of a newline. However, when reading the file with readFile, these characters are read as \n like a single newline character, instead of escaping the backslash and reading as \n.
UPDATE: I have closed this issue as the error was due to a bug in my own code.