Why can’t read german umlauts from a .txt file?

I need to read german text from a file and translate it into ascii-numbers. Of course it contains german umlauts ‘ä’, ‘ö’, ‘ü’ and the character ‘ß’ as well. After using fscanf my resulting string contains only the ‘?’, where these chars were. Changing the encoding in Matlab doesn’t work. Is it an issue with my operating system Mac OS? Here is a simple example:

fileID = fopen('text.txt','r');
string = fscanf(fileID,'%s');

and the content of my text.txt for testing:

Lorem ipösum dolor! sit am?et, consüetetur{ sadip$sciäng e&litr, sßed.

All the other special characters are read fine. The result is

string =    loremip?sumdolor!sitam?et,cons?etetur{sadip$sci?nge&litr,s?ed.

P.S. The removement of white space is alright in my application.

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

I tried reproducing the issue that you are facing but I was able to successfully read all the german umlauts from the .txt file. In my case,

string =Loremipösumdolor!sitam?et,consüetetur{sadip$sciänge&litr,sßed.

I am using MATLAB R2016b on a Windows 10 machine. Your issue seems to be related to your operating system.

SEE COMPLETE ANSWER CLICK THE LINK

--

--

--

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Things I learned today

Getting Started With Kotlin-React — Part III

What is the difference between EXW and FOB

Building a Fitness App with React Native

React 02 - SSR vs Responsive Design

Angular and legacy JavaScript integrations

Create a Zero-Setup Microservice with Unbounded

I Went From Dreading JavaScript to Liking It In One Week

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Technical Source

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

More from Medium

How to use Gamma distribution as the kernel of Naive Bayes in MATLAB code?

Detection of Autism Spectrum Disorder in Newborns Using Biomarkers Early After Birth and Logistic…

Random Boost the concept

Do Robots Seek Revenge?