Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
72d117b8
Commit
72d117b8
authored
Jun 14, 2019
by
Lee Jaebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#34085 【SATO android 1.0.0】オーサリングツールで作成した資料で文字化けが発生することがある
parent
d7557c42
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
+18
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ContentLogic.java
+2
-1
ABVJE_BL/src/jp/agentec/adf/util/FileUtil.java
+16
-0
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ContentLogic.java
View file @
72d117b8
...
@@ -506,7 +506,8 @@ public class ContentLogic extends AbstractLogic {
...
@@ -506,7 +506,8 @@ public class ContentLogic extends AbstractLogic {
* @throws IOException
* @throws IOException
*/
*/
public
ContentJSON
getContentInfoJson
(
String
contentDir
,
long
contentId
)
throws
IOException
{
public
ContentJSON
getContentInfoJson
(
String
contentDir
,
long
contentId
)
throws
IOException
{
String
text
=
FileUtil
.
readTextFile
(
contentDir
+
"/"
+
contentId
+
".json"
);
// 文字化けが発生するので文字コードをUTF-8で指定してファイルを読み込むように修正
String
text
=
FileUtil
.
readTextFileByUTF8
(
contentDir
+
"/"
+
contentId
+
".json"
);
if
(
StringUtil
.
isNullOrEmpty
(
text
))
{
if
(
StringUtil
.
isNullOrEmpty
(
text
))
{
return
null
;
return
null
;
}
}
...
...
ABVJE_BL/src/jp/agentec/adf/util/FileUtil.java
View file @
72d117b8
...
@@ -856,6 +856,22 @@ public class FileUtil {
...
@@ -856,6 +856,22 @@ public class FileUtil {
return
null
;
// TODO: later 暫定処置 とりあえずこのまま
return
null
;
// TODO: later 暫定処置 とりあえずこのまま
// throw new FileNotFoundException(path);
// throw new FileNotFoundException(path);
}
}
return
readTextFile
(
new
FileInputStream
(
file
));
}
/**
* 文字化け対応(修正する影響範囲が大きいので、[contentId].jsonで使用
* TODO ファイル読み込みのメソッド統一(文字コード指定:UTF-8)
* @param path
* @return
* @throws IOException
*/
public
static
String
readTextFileByUTF8
(
String
path
)
throws
IOException
{
File
file
=
new
File
(
path
);
if
(
file
.
length
()
==
0
)
{
return
null
;
// TODO: later 暫定処置 とりあえずこのまま
// throw new FileNotFoundException(path);
}
return
readTextFile
(
new
BufferedReader
(
new
InputStreamReader
(
new
FileInputStream
(
file
),
"UTF-8"
)));
return
readTextFile
(
new
BufferedReader
(
new
InputStreamReader
(
new
FileInputStream
(
file
),
"UTF-8"
)));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment