我在我的OSX上有一个PHP项目,它是在latin1 -encoding中.现在我需要将文件转换为UTF8.我不是一个shell编码器,我尝试过从互联网上找到的东西:
mkdir new
for a in `ls -R *`; do iconv -f iso-8859-1 -t utf-8 <"$a" >new/"$a" ; done
Run Code Online (Sandbox Code Playgroud)
但这不会创建目录结构,它会让我在运行时加载错误.任何人都可以拿出整洁的解决方案吗?
我正在尝试运行此代码(Ubuntu 12.04,R 3.1.1)
# Load requisite packages
library(tm)
library(ggplot2)
library(lsa)
# Place Enron email snippets into a single vector.
text <- c(
"To Mr. Ken Lay, I’m writing to urge you to donate the millions of dollars you made from selling Enron stock before the company declared bankruptcy.",
"while you netted well over a $100 million, many of Enron's employees were financially devastated when the company declared bankruptcy and their retirement plans were wiped out",
"you sold $101 million worth …Run Code Online (Sandbox Code Playgroud)