Aller au contenu
View in the app

A better way to browse. Learn more.

Forum de Frandroid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Problème de caractères spéciaux lors d'un import

Featured Replies

Posté(e)

Bonjour,

je suis entrain de terminé mon application et j'ai besoin de récupéré des données enregistré dans un fichier txt uploader sur la carte SD.

Dans le principe cela fonctionne sans problème.

Cependant lorsque le fichier contines certain caractères spéciaux comme des accents je me retrouve avec des tas de hyérogliphe.

Je pensais que l'UTF-8 m'aurait permis de réglé ce problème mais rien n'y fait.

Quelqu'un auraitil une idée du problème ?

Merci par avance pour votre aide.

Blubsy

try {
					   FileInputStream fis = new FileInputStream("/sdcard/mysdfile.txt");
					   InputStreamReader tempInputStreamReader = new InputStreamReader(fis);

					   String filePath = "/sdcard/mysdfile.txt";
					   //String UTF8 = "UTF-8";
					   String UTF8 = tempInputStreamReader.getEncoding();
					   int BUFFER_SIZE = 8192;

					   BufferedReader myReader = new BufferedReader(new InputStreamReader(new FileInputStream("/sdcard/mysdfile.txt"), UTF8),BUFFER_SIZE);


						String aDataRow= "";
						String aBuffer= "";
						while((aDataRow= myReader.readLine()) != null) {
							aBuffer+= aDataRow+ "\n";
						}
						txtData.setText(aBuffer);
						myReader.close();

						Toast.makeText(getBaseContext(),"Lecture du fichié SD 'mysdfile.txt'", 1).show();					   

					}catch (FileNotFoundException e){

					}catch (UnsupportedEncodingException e){

					}catch (IOException e) {

					}		

  • 1 month later...
Posté(e)

Coucou!

Je ne sais pas si ton souci est réglé mais, au cas où:

A mon avis, un ptit

aDataRow = aDataRow.replace("é","e");
aDataRow = aDataRow.replace("è","e");
aDataRow = aDataRow.replace("à","a");
...
...
...

ca devrait le faire...

Sinon, ajoute "[Résolu]" au début du titre de ton sujet... ;)

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.