Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7782] iOS: Able to read UTF-16 encoded text file

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 1.8.0.1, Release 1.8.1
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterNikhil Sharma
AssigneeUnknown
Created2012-02-22T17:00:22.000+0000
Updated2018-03-06T18:57:57.000+0000

Description

One should be able to open, get the content and then display UTF-16 encoded TXT files into a Ti.UI.TextArea. There is a workaround in iPad to read the UTF-16 encoded file with the help of Titanium.UI.iPad.DocumentViewer

Repro Steps

1. Run the below code. 2. Can't read the UTF-16 encoded text file, everything works fine with UTF-8 encoded file.
var win = Ti.UI.createWindow(); 
var textArea = Ti.UI.createTextArea({width:"100%", height:"100%", backgroundColor:"#FFFFFF"}); 
textArea.value = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory,"WBCTDOC_806.txt").read().text; 
win.add(textArea); 
win.open();

Attached is the file which is to be opened.

Attachments

FileDateSize
WBCTDOC_806.txt2012-02-22T17:00:22.000+0000204

Comments

No comments

JSON Source