Character Encoding Problem with ReadList

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
1












I have a .srt file (subtitle file) with the following text:




Chapitre 1 : Systèmes d'équations linéaires et matrices




However when I import it into Mathematica, using:



subRip = ReadList[subRibFile, String];


I get:




Chapitre 1 : Systèmes d'équations linéaires et matrices




How can I avoid that ?










share|improve this question





















  • What do you get if you do Import[ subRibFile, "Text"]?
    – Jason B.
    yesterday










  • @JasonB. Thanks for your comment. In that case, I get one string which is not seperated by lines... but the output is correctly decoded. :)
    – james
    yesterday














up vote
2
down vote

favorite
1












I have a .srt file (subtitle file) with the following text:




Chapitre 1 : Systèmes d'équations linéaires et matrices




However when I import it into Mathematica, using:



subRip = ReadList[subRibFile, String];


I get:




Chapitre 1 : Systèmes d'équations linéaires et matrices




How can I avoid that ?










share|improve this question





















  • What do you get if you do Import[ subRibFile, "Text"]?
    – Jason B.
    yesterday










  • @JasonB. Thanks for your comment. In that case, I get one string which is not seperated by lines... but the output is correctly decoded. :)
    – james
    yesterday












up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





I have a .srt file (subtitle file) with the following text:




Chapitre 1 : Systèmes d'équations linéaires et matrices




However when I import it into Mathematica, using:



subRip = ReadList[subRibFile, String];


I get:




Chapitre 1 : Systèmes d'équations linéaires et matrices




How can I avoid that ?










share|improve this question













I have a .srt file (subtitle file) with the following text:




Chapitre 1 : Systèmes d'équations linéaires et matrices




However when I import it into Mathematica, using:



subRip = ReadList[subRibFile, String];


I get:




Chapitre 1 : Systèmes d'équations linéaires et matrices




How can I avoid that ?







import string-manipulation






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked yesterday









james

845418




845418











  • What do you get if you do Import[ subRibFile, "Text"]?
    – Jason B.
    yesterday










  • @JasonB. Thanks for your comment. In that case, I get one string which is not seperated by lines... but the output is correctly decoded. :)
    – james
    yesterday
















  • What do you get if you do Import[ subRibFile, "Text"]?
    – Jason B.
    yesterday










  • @JasonB. Thanks for your comment. In that case, I get one string which is not seperated by lines... but the output is correctly decoded. :)
    – james
    yesterday















What do you get if you do Import[ subRibFile, "Text"]?
– Jason B.
yesterday




What do you get if you do Import[ subRibFile, "Text"]?
– Jason B.
yesterday












@JasonB. Thanks for your comment. In that case, I get one string which is not seperated by lines... but the output is correctly decoded. :)
– james
yesterday




@JasonB. Thanks for your comment. In that case, I get one string which is not seperated by lines... but the output is correctly decoded. :)
– james
yesterday










1 Answer
1






active

oldest

votes

















up vote
2
down vote



accepted










This is a bit of a workaround, using "import" but it works !



subRipIm = Import[subRibFile, "Text", CharacterEncoding -> "UTF8"];
subRip = DeleteCases[StringSplit[ToString[subRipIm], "n"], ""];





share|improve this answer




















  • Thanks a lot ! This works ! :)
    – james
    yesterday










Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f183290%2fcharacter-encoding-problem-with-readlist%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote



accepted










This is a bit of a workaround, using "import" but it works !



subRipIm = Import[subRibFile, "Text", CharacterEncoding -> "UTF8"];
subRip = DeleteCases[StringSplit[ToString[subRipIm], "n"], ""];





share|improve this answer




















  • Thanks a lot ! This works ! :)
    – james
    yesterday














up vote
2
down vote



accepted










This is a bit of a workaround, using "import" but it works !



subRipIm = Import[subRibFile, "Text", CharacterEncoding -> "UTF8"];
subRip = DeleteCases[StringSplit[ToString[subRipIm], "n"], ""];





share|improve this answer




















  • Thanks a lot ! This works ! :)
    – james
    yesterday












up vote
2
down vote



accepted







up vote
2
down vote



accepted






This is a bit of a workaround, using "import" but it works !



subRipIm = Import[subRibFile, "Text", CharacterEncoding -> "UTF8"];
subRip = DeleteCases[StringSplit[ToString[subRipIm], "n"], ""];





share|improve this answer












This is a bit of a workaround, using "import" but it works !



subRipIm = Import[subRibFile, "Text", CharacterEncoding -> "UTF8"];
subRip = DeleteCases[StringSplit[ToString[subRipIm], "n"], ""];






share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









henry

1,250423




1,250423











  • Thanks a lot ! This works ! :)
    – james
    yesterday
















  • Thanks a lot ! This works ! :)
    – james
    yesterday















Thanks a lot ! This works ! :)
– james
yesterday




Thanks a lot ! This works ! :)
– james
yesterday

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f183290%2fcharacter-encoding-problem-with-readlist%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?